87,910
社区成员
发帖
与我相关
我的任务
分享
<!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>