Hey guys,
I've followed this tutorial: http://www.noupe.com/tutorial/drop-down-menu-jquery-css.html
I adapted it to make it so the menu slides down when you put your mouse over, instead of clicking it.
I also integrated "hoverIntent" to it.
I am having problems with it though.
If you visit my website at: www.roxbourne.com
Sometimes the services menu won't slide back up and gets stuck. I don't understand how something can be so intermittent.
Here is the Jquery:
jQuery(document).ready(function(){
jQuery("ul.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled - Adds empty span tag after ul.subnav
jQuery("ul.topnav li.drop").mouseover(function() { //When trigger is clicked...
//Following events are applied to the subnav itself (moving subnav up and down)
jQuery(this).parent().find("ul.subnav").slideDown('slow').show(); //Drop down the subnav on click
jQuery(this).parent().hoverIntent(function() {
}, function(){
jQuery(this).parent().find("ul.subnav").stop().slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
});
//Following events are applied to the trigger (Hover events for the trigger)
}).hoverIntent(function() {
jQuery(this).addClass("subhover"); //On hover over, add class "subhover"
}, function(){ //On Hover Out
jQuery(this).removeClass("subhover"); //On hover out, remove class "subhover"
});
});
I'd be very grateful if anyone could help. Thanks in advance.