Changeset 1575
- Timestamp:
- Feb 28, 2011, 5:25:10 PM (12 years ago)
- Location:
- trunk/web-app
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web-app/css/default_style.css
r1548 r1575 98 98 } 99 99 100 ul.topnav li a:hover {100 ul.topnav li a:hover, ul.topnav li a.tophover { 101 101 background: url(../images/default_style/topnav/topnav_hover.gif) no-repeat center top; 102 102 } -
trunk/web-app/js/topnav.js
r959 r1575 1 $(document).ready(function(){ 2 $("ul.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled (Adds empty span tag after ul.subnav*) 3 $("ul.topnav li").click(function() { //When trigger is clicked... 4 //Following events are applied to the subnav itself (moving subnav up and down) 5 $(this).find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click 6 $(this).parent().hover(function() { 7 }, function(){ 8 $(this).parent().find("ul.subnav").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up 9 }); 1 $(document).ready(function() { 2 $("ul.subnav").parent().append("<span></span>"); 10 3 11 //Following events are applied to the trigger (Hover events for the trigger) 12 }).hover(function() { 13 $(this).addClass("subhover"); //On hover over, add class "subhover" 14 }, function(){ //On Hover Out 15 $(this).removeClass("subhover"); //On hover out, remove class "subhover" 16 }); 4 // menu label 5 $("ul.topnav li span").parent().click( 6 function() { 7 $(this).find("ul.subnav").slideDown('fast').show(); 8 $(this).hover(function() { 9 }, function() { 10 $(this).find("ul.subnav").slideUp('slow'); 11 }); 12 }).hover(function() { 13 $("span", this).addClass("subhover"); 14 }, function() { 15 $("span", this).removeClass("subhover"); 16 } 17 ); 17 18 18 // make sure navigation is on top of everything 19 $("ul.subnav").css( { 'z-index': '1000' } ); 20 }); 19 // menu icon 20 $("ul.topnav li span").click( 21 function() { 22 $(this).parent().find("ul.subnav").slideDown('fast').show(); 23 $(this).parent().hover(function() { 24 }, function() { 25 $(this).parent().find("ul.subnav").slideUp('slow'); 26 }); 27 }).hover(function() { 28 $("a", $(this).parent()).addClass("tophover"); 29 $(this).addClass("subhover"); 30 }, function() { 31 $("a", $(this).parent()).removeClass("tophover"); 32 $(this).removeClass("subhover"); 33 } 34 ); 35 36 // make sure navigation is on top of everything 37 $("ul.subnav").css({ 'z-index': '1000' }); 38 });
Note: See TracChangeset
for help on using the changeset viewer.