您的位置:首页 > 其它

neusoft.shixi__任务一

2015-07-28 18:08 316 查看
**“不管怎么样来了,签了6个月实习,也不知道学会到啥,不想那么多了,

—-毕竟东软,刚开始让先做前段的设计那就做吧,谁让咱是实习生呢**

任务一

实现前段的一个隐藏模块,自己主要实现代码如下:

html>
<head>

<style>
#menu_nav{
background-color: #80776F;
color:#fff;
height:auto;
border-radius:10px;
overflow:hidden;
traslation:all.5s;
z-index:10;
width:100%;
}

#tubiao{margin-left: 50%;}
#tubiao img{width: 25px;height:25px;}
</style>
</head>
<body>
<div background-color:#766>
<span id ="tubiao">
<img id ="aas" src="./mm_arrow_up.png" onclick="menu()"></img>
</span>
</div>
<div id ="menu_nav">
</br>
<p>adsada</p>
<p>sdsada</p>
</div>

<script language="javascript">
(function(window, id, undefined) {
window.config = {
isOpen : true,
trueHeight : document.getElementById(id).scrollHeight

};
document.getElementById(id).style.height = window.config.trueHeight+ "px";
window.menu = function() {
var imgObj = document.getElementById("aas");
var o = document.getElementById(id);
if (config.isOpen) {
imgObj.src = "./mm_arrow_down.png";
window.config.isOpen = false;
o.style.height = "0px";

} else {
imgObj.src = "./mm_arrow_up.png";
window.config.isOpen = true;
o.style.height = window.config.trueHeight + "px";

}
}
})(window, "menu_nav");
</script>
</body>
</html>






内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: