Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
Solution for Long Drop Down Items
Really Tall Menu
Lorem
Ipsum
Dolor
Lipsum
Consectetur
Duis
Sed
Natus
Excepteur
Voluptas
Voluptate
Malorum
Bonorum
Nemo
Quisquam
Adipisci
Excepteur
Consectetur
Duis
Voluptate
Ipsum
Dolor
Lipsum
Kinda Tall Menu
Lorem
Ipsum
Dolor
Lipsum
Consectetur
Duis
Sed
Natus
Excepteur
Voluptas
Voluptate
Malorum
Bonorum
Nemo
Quisquam
Average Menu
Lorem
Ipsum
Dolor
Lipsum
Consectetur
No Menu
css
body{ margin: 0px; padding: 0px; background: #e74c3c; font-family: 'Lato', sans-serif; } h1{ margin: 2em 0px; padding: 0px; color: #fff; text-align: center; font-weight: 100; font-size: 50px; } nav{ width: 750px; margin: 1em auto; } ul{ margin: 0px; padding: 0px; list-style: none; } ul.dropdown{ position: relative; width: 100%; } ul.dropdown li{ font-weight: bold; float: left; width: 180px; position: relative; background: #ecf0f1; } ul.dropdown a:hover{ color: #000; } ul.dropdown li a { display: block; padding: 20px 8px; color: #34495e; position: relative; z-index: 2000; text-align: center; text-decoration: none; font-weight: 300; } ul.dropdown li a:hover, ul.dropdown li a.hover{ background: #3498db; position: relative; color: #fff; } ul.dropdown ul{ display: none; position: absolute; top: 0; left: 0; width: 180px; z-index: 1000; } ul.dropdown ul li { font-weight: normal; background: #f6f6f6; color: #000; border-bottom: 1px solid #ccc; } ul.dropdown ul li a{ display: block; color: #34495e !important; background: #eee !important; } ul.dropdown ul li a:hover{ display: block; background: #3498db !important; color: #fff !important; } .drop > a{ position: relative; } .drop > a:after{ content:""; position: absolute; right: 10px; top: 40%; border-left: 5px solid transparent; border-top: 5px solid #333; border-right: 5px solid transparent; z-index: 999; } .drop > a:hover:after{ content:""; border-left: 5px solid transparent; border-top: 5px solid #fff; border-right: 5px solid transparent; }
JavaScript
var maxHeight = 400; $(function(){ $(".dropdown > li").hover(function() { var $container = $(this), $list = $container.find("ul"), $anchor = $container.find("a"), height = $list.height() * 1.1, // make sure there is enough room at the bottom multiplier = height / maxHeight; // needs to move faster if list is taller // need to save height here so it can revert on mouseout $container.data("origHeight", $container.height()); // so it can retain it's rollover color all the while the dropdown is open $anchor.addClass("hover"); // make sure dropdown appears directly below parent list item $list .show() .css({ paddingTop: $container.data("origHeight") }); // don't do any animation if list shorter than max if (multiplier > 1) { $container .css({ height: maxHeight, overflow: "hidden" }) .mousemove(function(e) { var offset = $container.offset(); var relativeY = ((e.pageY - offset.top) * multiplier) - ($container.data("origHeight") * multiplier); if (relativeY > $container.data("origHeight")) { $list.css("top", -relativeY + $container.data("origHeight")); }; }); } }, function() { var $el = $(this); // put things back to normal $el .height($(this).data("origHeight")) .find("ul") .css({ top: 0 }) .hide() .end() .find("a") .removeClass("hover"); }); });
粒子
时间
文字
hover
canvas
3d
游戏
音乐
火焰
水波
轮播图
鼠标跟随
动画
css
加载动画
导航
菜单
按钮
滑块
tab
弹出层
统计图
svg
×
Close
在线代码下载提示
开通在线代码永久免费下载,需支付20jQ币
开通后,在线代码模块中所有代码可终身免费下!
您已开通在线代码永久免费下载,关闭提示框后,点下载代码可直接下载!
您已经开通过在线代码永久免费下载
对不起,您的jQ币不足!可通过发布资源 或
直接充值获取jQ币
取消
开通下载
<!doctype html> <html> <head> <meta charset="utf-8"> <title>jQuery导航菜单-jq22.com</title> <script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script> <style>
</style> </head> <body>
<script>
</script>
</body> </html>
2012-2021 jQuery插件库版权所有
jquery插件
|
jq22工具库
|
网页技术
|
广告合作
|
在线反馈
|
版权声明
沪ICP备13043785号-1
浙公网安备 33041102000314号