菜单切换 - 页面正在加载,菜单已展开

时间:2013-11-02 22:42:31

标签: toggle

我的网站www.callumritchie.com上的菜单有问题

当我加载网站时,页面顶部的菜单已经展开,然后当您单击菜单图标时,它会隐藏它。

我希望在加载页面时隐藏菜单,要求访问者点击菜单图标以显示/展开菜单。

HTML                                      家         工作         联系         关于          

jquery的

$("#menuicon").click(function () {
$("#sitemenu").show("fast");
});

CSS

#switch {
cursor: pointer;
float: left;
position: relative;
z-index: 2;
background-color: #6ea9ca;
border-left: 15px solid #6ea9ca;
border-top: 15px solid #6ea9ca;
border-bottom: 15px solid #6ea9ca;
}
#switch img {
transition: transform .25s linear;
-moz-transition: -moz-transform .25s linear;
-webkit-transition: -webkit-transform .25s linear;
-o-transition: -o-transform .25s linear;
}
#menu nav {
font-family:'DroidSans';
margin-top: 23px;
display: inline-block;
position: relative;
height: 36px;
z-index: 1;
transition: all .25s linear;
-moz-transition: all .25s linear;
-webkit-transition: all .25s linear;
-o-transition: all .25s linear;
}
#menu.active nav {
left: -20em;
opacity: 0;
 }
#menu.active #switch img {
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
transform: rotate(90deg);
}

1 个答案:

答案 0 :(得分:0)

尝试:     $(document).ready(function(){$("#sitemenu").hide()});

响应中的编辑:只需将#sitemenu替换为您想要隐藏的元素的ID。