求解中间的效果如何实现

Xiao灬佳 2016-09-29 03:51:18
就是中间那几张大图的效果

特别是那个【展开进一步了解】

点开和关闭之后那种平滑的动画效果

http://www.apple.com/cn/apple-watch-series-2/
...全文
71 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Xiao灬佳 2016-09-29
  • 打赏
  • 举报
回复
引用 1 楼 jslang 的回复:
css3的 transition:

<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
	<title> 页面名称 </title>
<style type="text/css">
#a {
	height: 200px;
	background-color: #DDD;
}
#b {
	height: 0px;
	background-color: #f00;
	overflow: hidden;
	-webkit-transition: all 500ms ease-out;
	transition: all 500ms ease-out;
}
#b.on {
	height: 300px;
	margin-top: -50px;
}
#c {
	height: 200px;
	background-color: #999;
}
</style>
</head>
<body>

<div id="a">
	<input type="button" value="【展开进一步了解】" onclick="func();" />
</div>
<div id="b"></div>
<div id="c"></div>
<script type="text/javascript">
function func() {
	var id = document.getElementById("b");
	id.className = id.className == "" ? "on" : "";
}
</script>
</body>
</html>
谢谢,大致懂了
天际的海浪 2016-09-29
  • 打赏
  • 举报
回复
css3的 transition:

<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
	<title> 页面名称 </title>
<style type="text/css">
#a {
	height: 200px;
	background-color: #DDD;
}
#b {
	height: 0px;
	background-color: #f00;
	overflow: hidden;
	-webkit-transition: all 500ms ease-out;
	transition: all 500ms ease-out;
}
#b.on {
	height: 300px;
	margin-top: -50px;
}
#c {
	height: 200px;
	background-color: #999;
}
</style>
</head>
<body>

<div id="a">
	<input type="button" value="【展开进一步了解】" onclick="func();" />
</div>
<div id="b"></div>
<div id="c"></div>
<script type="text/javascript">
function func() {
	var id = document.getElementById("b");
	id.className = id.className == "" ? "on" : "";
}
</script>
</body>
</html>

87,910

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧