jquery实现简洁下拉菜单效果代码
代码语言:html
所属分类:菜单导航
代码描述:jquery实现简洁下拉菜单效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<html> <head> <style> 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; } </style> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/jquery.17.js"></script> </head> <body style=""> <h1>Solution for Long Drop Down Items</h1> <nav> <ul class="dropdown"> <li class="drop" style="height: 61px; overflow: hidden;"><a href="#" class="">Really Tall Menu</a> <ul class="sub_menu" style="display: none; padding-top: 61px; top: 0px;"> <li><a href="#" class="">Lorem</a></li> <li><a href="#" class="">Ipsum</a></li> <li><a href="#" class="">Dolor</a></li> <li><a href="#" class="">Lipsum</a></li> <li><a href="#" class="">Consectetur </a></li> <li><a href="#" class="">Duis</a></li> <li><a href="#" class="">Sed</a></li> <li><a href="#" class="">Natus</a></li> <li><a href="#" class="">Excepteur</a></li> <li><a href="#" class="">Voluptas</a></li> <li><a href="#" class="">Voluptate</a></li> <li><a href="#" class="">Malorum</a></li> <li><a href="#" class="">Bonorum</a></li> <li><a href="#" class="">Nemo</a></li> <li><a href="#" class="">Quisquam</a></li> <li><a href="#" class="">Adipisci </a></li> <li><a href="#" class="">Excepteur</a></li> <li><a href="#" class="">Consectetur </a></li> <li><a href="#" class="">Duis</a></li> <li><a href="#" class="">Voluptate</a></li> <li><a href="#" class="">Ipsum</a></li> <li><.........完整代码请登录后点击上方下载按钮下载查看
网友评论0