Difference between revisions of "Template:HSNU-TAIPEI/js/nav"
(30 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
var menu = $("#main-menu"), | var menu = $("#main-menu"), | ||
showLeft = $(".showLeft"), | showLeft = $(".showLeft"), | ||
− | menuButton = $(".menu-button"); | + | menuButton = $(".menu-button"), |
+ | secondLayerList = $(".seclayer"); | ||
function toggleMenu() { | function toggleMenu() { | ||
Line 12: | Line 13: | ||
showLeft.click(toggleMenu); | showLeft.click(toggleMenu); | ||
+ | |||
+ | secondLayerList.hover( | ||
+ | function() { | ||
+ | $(this).children('.seclayer-nav').fadeIn('fast'); | ||
+ | }, function() { | ||
+ | $(this).children('.seclayer-nav').fadeOut('fast'); | ||
+ | } | ||
+ | ); | ||
Line 19: | Line 28: | ||
if(event.pageY <= 20) { | if(event.pageY <= 20) { | ||
nav_bar.fadeIn(); | nav_bar.fadeIn(); | ||
− | + | } else if(nav_bar.filter(':hover').length === 0) { | |
− | + | nav_bar.fadeOut(); | |
− | + | ||
} | } | ||
}); | }); |
Latest revision as of 15:54, 3 April 2015