教学 ♥ 隐藏 navbar
09 December 2011 @ 3:21 PM
转帖请留言和附上链接 ♥
这个呢 跟删除 navbar 的那篇不一样喔
这个是当鼠标指向那个 navbar 的时候
Navbar 才会出现的 在平时是不会出现的 (:
1 Design > Edit layout > Add a gadget > Html/JavaScript
2 把以下代码放进去 (:
<!-- DROPDOWN NAVBAR -->
<!-- stylesheet for FF2, Op9, IE7 (strict mode) -->
<style type="text/css">
#navbar {
display:inline;
width:100%;
position:absolute;
background-color:transparent;
top:-30px;
left:0px;
height:60px;
z-index:999999;
}
#navbar:hover{
top:0px;
height:30px;
}
</style>
<!-- stylesheet for IE6 and lower -->
<!-- (not supporting element:hover) -->
<!-- first, unhide the navbar through css -->
<!-- second, hide the navbar and mimic -->
<!-- the effect with javascript, if available -->
<!--[if lt IE 7]>
<style type="text/css">
#navbar {
height:30px;
top:0px;
}
</style>
<script type="text/javascript">
var navbar = document.getElementById('navbar');
if(navbar){
navbar.onmouseover = function(){
navbar.style.top = '0px';
navbar.style.height = '30px';
}
navbar.onmouseout = function(){
navbar.style.top = '-30px';
navbar.style.height = '60px';
}
if (navbar.captureEvents){
navbar.captureEvents(Event.MOUSEOVER);
navbar.captureEvents(Event.MOUSEOUT);
}
navbar.onmouseout();
}
</script>
<![endif]-->
<!-- end dropdown navbar -->
4 然后按 save 就可以了哦
不明白的话可以留下评论问我
或者是在 Tagboard 那里留言给我哦 ^^
Copyrighted by Ahhxuan. ♥