Difference between revisions of "Template:HSNU-TAIPEI/js/nav"
(15 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'); | ||
+ | } | ||
+ | ); | ||
var nav_bar = $("#top_menu_14"); | var nav_bar = $("#top_menu_14"); | ||
− | |||
nav_bar.hide(); | nav_bar.hide(); | ||
$(document).mousemove(function(event) { | $(document).mousemove(function(event) { | ||
if(event.pageY <= 20) { | if(event.pageY <= 20) { | ||
− | + | nav_bar.fadeIn(); | |
− | + | } else if(nav_bar.filter(':hover').length === 0) { | |
− | + | nav_bar.fadeOut(); | |
− | } else | + | |
− | + | ||
− | + | ||
− | + | ||
} | } | ||
}); | }); | ||
− | |||
</script> | </script> | ||
</html> | </html> |
Latest revision as of 15:54, 3 April 2015