neusoft.shixi__任务一

来源:互联网 发布:程序员数学 编辑:程序博客网 时间:2024/05/01 02:32

**“不管怎么样来了,签了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>

把上边的小框点击隐藏
一样

这里写图片描述

0 0
原创粉丝点击