当前位置: 编程技术>jquery
jquery实现的固定底部的菜单代码
来源: 互联网 发布时间:2014-09-03
本文导语: 分享一款固定在页面底部的菜单。 代码: 固定底(顶)部菜单-www. body {padding:0; margin:0; font-size:12px; font-family:Arial; word-break:break-all; word-wrap:break-word; } .bnav { text-align:left; height:25px; overflow:hidden; width:98%; line-height:25px; back...
分享一款固定在页面底部的菜单。
代码:
固定底(顶)部菜单-www.
body {padding:0; margin:0; font-size:12px; font-family:Arial; word-break:break-all; word-wrap:break-word; }
.bnav { text-align:left; height:25px; overflow:hidden; width:98%; line-height:25px; background:#fff; margin:0 1%; border:#B4B4B4 1px solid;
border-bottom:none; z-index:999; position:fixed; bottom:0; left:0; _position:absolute;/* for IE6 */
_top: expression(documentElement.scrollTop + documentElement.clientHeight-this.offsetHeight); /* for IE6 */
overflow:visible; }
.close { position:absolute; right:5px; height:25px; width:16px; text-indent:-9999px; padding-left:10px; }
.close a { background:url(/images/20110603/close.gif) no-repeat center; width:16px; display:block; }
.bnav2 { height:24px; line-height:24px; margin:1px; margin-bottom:0; background:#E5E5E5; }
.bnav3 { height:25px; width:16px; line-height:25px; margin:0 1%; padding-right:6px; border-bottom:none; z-index:999; position:fixed;
bottom:0; right:0; _position:absolute;/* for IE6 */ _top: expression(documentElement.scrollTop + documentElement.clientHeight-this.offsetHeight);
/* for IE6 */
overflow:visible; }
.bnav3 a { background:url(/images/20110603/open.gif) no-repeat center; display:block; height:25px; width:16px; text-indent:-5000px; }
var closeBN = $.cookie("bnav");
if (closeBN == "0"){closeNav();}
function showNav(){
$(".openClose").toggle();
$.cookie("bnav", "1", {expires: 1});
}
function closeNav(){
$(".openClose").toggle();
$.cookie("bnav", "0", {expires: 1});
}
关闭
脚本学堂,欢迎大家的光临。这里是菜单部分。