I am building a drop down menu using jQuery and CSS. When you hove a menu item, a list of sub-menu items is revealed below it.
However, because this affects the height of the menu overall (the submenu pushes menu items below it down), it can create an unwanted bouncing effect when trying to navigate.
I'm thinking that I could prevent this by delay the jQuery function that toggles the submenu until the previous toggle has been completed.
Is this possible?
Look at the fiddle below,, here is my current js:
$(document).ready(function () { // Shows animates submenu transition
$("ul.available_actions li").hover(function () {
$("ul.available_actions li ").removeClass("menu_show");
$(this).delay(30).addClass("menu_show");
$(".menu_show ul li").toggle(170);
});
});
Here is a link to a fiddle: http://jsfiddle.net/msEKE/
(Please ignore the submenu items, it's using Asp.Net MVC)