jquery - Put the links in a list without a html list -
i'm using asp.net , html code gets generated. now, want make dropdownmenu (which made jquery)to display list. can see links written in line. have write them among themselves. , have menu dropdown under menu hover. know do?
$(document).ready(function() { $("[id$=submenu]").hide(); $(".menu_link, .submenu_panel").hover(function() { //hover inn function var nthnumber = $(this).index() + 1; $("[id$=submenu] .submenu_panel").hide(); $("[id$=submenu]").show(); $("[id$=submenu] .submenu_panel:nth-of-type(" + nthnumber + ")").show(); }, function() { //hover out function $("[id$=submenu]").hide(); var nthnumber = $(this).index() + 1; $("[id$=submenu] .submenu_panel:nth-of-type(" + nthnumber + ")").hide(); }); });
#pnlmenu .menu_link:hover #pnlsubmenu .submenu_link { height: 50px; display: block; } #wrapper_menu { margin-bottom: 50px; position: relative; z-index: 1; } #menuicon { margin: 0 auto; width: 27px; display: none; } .menubar { background: #001155; height: 4px; width: 27px; margin-bottom: 5px; border-radius: 2px; position: relative; -webkit-transition: 0.3s ease-out; -moz-transition: 0.3s ease-out; -ms-transition: 0.3s ease-out; -o-transition: 0.3s ease-out; transition: 0.3s ease-out; } #menuicon:hover #menubar-top { transform: translate(0px, 9px) rotate(45deg); } #menuicon:hover #menubar-mid { opacity: 0; } #menuicon:hover #menubar-bottom { transform: translate(0px, -9px) rotate(-45deg); } #menu { height: 44px; width: 980px; margin: 0 auto; border-radius: 5px; background: rgb(229, 229, 229); /* old browsers */ background: -moz-linear-gradient(top, rgba(229, 229, 229, 0.95) 0%, rgba(193, 192, 194, 0.95) 100%); /* ff3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(229, 229, 229, 0.95)), color-stop(100%, rgba(193, 192, 194, 0.95))); /* chrome,safari4+ */ background: -webkit-linear-gradient(top, rgba(229, 229, 229, 0.95) 0%, rgba(193, 192, 194, 0.95) 100%); /* chrome10+,safari5.1+ */ background: -o-linear-gradient(top, rgba(229, 229, 229, 0.95) 0%, rgba(193, 192, 194, 0.95) 100%); /* opera 11.10+ */ background: -ms-linear-gradient(top, rgba(229, 229, 229, 0.95) 0%, rgba(193, 192, 194, 0.95) 100%); /* ie10+ */ background: linear-gradient(to bottom, rgba(229, 229, 229, 0.95) 0%, rgba(193, 192, 194, 0.95) 100%); /* w3c */ filter: progid: dximagetransform.microsoft.gradient(startcolorstr='#e5e5e5', endcolorstr='#c1c0c2', gradienttype=0); /* ie6-9 */ -webkit-box-shadow: 0px 2px 2px 0px rgba(50, 50, 50, 0.5); -moz-box-shadow: 0px 2px 2px 0px rgba(50, 50, 50, 0.5); box-shadow: 0px 2px 2px 0px rgba(50, 50, 50, 0.5); } #pnlmenu { width: 100%; height: 100%; } .menu_link { float: left; font-size: 15px; line-height: 44px; padding: 0 13px; } .active_menu_link { color: #2d98e5; border-radius: 5px; background: rgb(229, 229, 229); /* old browsers */ background: -moz-linear-gradient(top, rgba(193, 192, 194, 0.95) 0%, rgba(229, 229, 229, 0.95) 100%); /* ff3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(193, 192, 194, 0.95)), color-stop(100%, rgba(229, 229, 229, 0.95))); /* chrome,safari4+ */ background: -webkit-linear-gradient(top, rgba(193, 192, 194, 0.95) 0%, rgba(229, 229, 229, 0.95) 100%); /* chrome10+,safari5.1+ */ background: -o-linear-gradient(top, rgba(193, 192, 194, 0.95) 0%, rgba(229, 229, 229, 0.95) 100%); /* opera 11.10+ */ background: -ms-linear-gradient(top, rgba(193, 192, 194, 0.95)) 0%, rgba(229, 229, 229, 0.95) 100%); /* ie10+ */ background: linear-gradient(to bottom, rgba(193, 192, 194, 0.95) 0%, rgba(229, 229, 229, 0.95) 100%); /* w3c */ filter: progid: dximagetransform.microsoft.gradient(endcolorstr='#c1c0c2', startcolorstr='#e5e5e5', gradienttype=0); /* ie6-9 */ -webkit-box-shadow: inset 0px 0px 7px 0px rgba(50, 50, 50, 0.3); -moz-box-shadow: inset 0px 0px 7px 0px rgba(50, 50, 50, 0.3); box-shadow: inset 0px 0px 7px 0px rgba(50, 50, 50, 0.3); } .last_menu_link { float: right; } .submenu_link {} .submenu_panel { width: 100%; height: 100%; height: 0px; background: gray; overflow: hidden; transition: 0.2s ease-in-out; } .menu_link:hover .submenupanel { height: 50px }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div id="wrapper_menu"> <div id="menuicon"> <div class="menubar" id="menubar-top"></div> <div class="menubar" id="menubar-mid"></div> <div class="menubar" id="menubar-bottom"></div> </div> <nav id="menu"> <div id="pnlmenu"> <a class="menu_link" href="index.aspx?category=1">menu1</a><a class="menu_link" href="index.aspx?category=2">menu2</a><a class="menu_link active_menu_link" href="index.aspx?category=4">menu3</a><a class="menu_link" href="index.aspx?category=5">menu4</a> <a class="menu_link" href="index.aspx?category=6">menu5</a><a href="index.aspx?category=8">menu6</a> </div> <div id="pnlsubmenu" style="display:none"> <div class="submenu_panel" style="height:100px"> <a class="submenu_link" href="pages/chart.aspx?id=7">link3</a><a class="submenu_link" href="pages/chart.aspx?id=8">link4</a> </div> <div class="submenu_panel" style="height:100px"> <a class="submenu_link" href="pages/chart.aspx?id=4">link1</a> <a class="submenu_link" href="pages/chart.aspx?id=11">link2</a> </div> </div> </nav> </div>
Comments
Post a Comment