var k_ul = $(this).parent().find("ul");
if (k_ul.length < 1)
return;
k_ul.css({ "background-color": settings.item_background_color_hover, "top": $(this).parent().position().top - (k_ul.height())
, "left": "0px", "margin": "0px"
}).show();
if (k_ul.width() < $(this).parent().width())
k_ul.width($(this).parent().width());
});
$(this).find(">li").mouseleave(function () {
$(this).find("ul").hide();
$(this).css("background-color", settings.item_background_color);
});
function ie6FixedBottom(fixedobj, bottommargin) {
fixedobj.css({ "position": "absolute" });
var k_bm = new Number;
k_bm = Number(bottommargin.substring(0, bottommargin.length - 2));
var obj = fixedobj[0];
function setStyleTop() {
obj.style.top = document.documentElement.scrollTop + document.documentElement.clientHeight
- obj.offsetHeight - (parseInt(obj.currentStyle.marginTop, 0) || k_bm) - (parseInt(obj.currentStyle.marginBottom, 0) || k_bm)
}
window.onscroll = function () { setStyleTop(); }
window.onresize = function () { setStyleTop(); }
}
}
} (jQuery));
插件css文件:
div.keleyi-menubar{width:100%;visibility:visible;padding:0px;}
ul.keleyi-menu{list-style-type:none;padding:0px;}
ul.keleyi-menu a{text-decoration:none}
ul.keleyi-menu a:hover{text-decoration:underline;}
ul.keleyi-menu>li li{padding:0px;}
ul.keleyi-menu li b{
display:inline-block;
width: 0;
height: 0;
border-width: 4px 4px;
border-style: solid;
border-color: transparent transparent #fff;
font-size: 0;
line-height: 0;
-moz-transition: -moz-transform .2s ease-in;
-o-transition: -o-transform .2s ease-in;
transition: transform .2s ease-in;
vertical-align:text-top;
margin-left:5px
}jQuery菜单插件例子:
<!DOCTYPE html>
<html>
<head>
<title>Keleyi Menu (jQuery Plugin)0.1.6 Demo- keleyi.com</title>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="jquery.keleyi.js"></script>
<link href="jquery.keleyi.css" type="text/css" rel="Stylesheet" />
<style>body{margin: 0px;}</style>
</head>
<body>
<div style="text-align:center;width:986px;margin:0px auto;">
<h1>
Keleyi</h1>
A jQuery Menu Plugin
<h2>Browser Support</h2>
Keleyi 0.1.4-0.1.6:IE6+,Chrome,Firefox,Opera,Safari<br />
Keleyi 0.1.3:IE8+(not support IE6),Chrome,Firefox,Opera,Safari
</div>
<div style="height: 360px;background-color: #66FF66;"></div>










