![]() |
hoverIntent problem for megamenu dropdown
Hi,
I'm a newbie to the forums here and a very unexperienced web developer. I have just set up my own website and I'm trying to make my menu less sensitive as it shoots down as soon as the mouse scrolls over which is annoying to potential customers. The change I made worked fine except as soon as I moved off the main header of the menu the full menu slides up again making it impossible to click on sub categories. I understand my problem is that my hoverIntent code is set to scroll back up on mouse out of the .cat but I have no idea where to put $(".menuContainer") in the hoverIntent function on mouse out to make sure it only scrolls up if someone's mouse leaves the entire container. I am completely and utterly lost, please help! The old code was this: [CODE]<script type="text/javascript"> $(".cat").mouseover(function(){if($("#sub"+this.id).length){if($(".subcat").is(":visible"){$(".subca t").hide()}$("#sub"+this.id).slideDown()}else{if($(".subcat").is(":visible")){$(".subcat").slideUp() }}});$(".menuContainer").bind("mouseleave",function(){$(".subcat").slideUp()}); </script>[CODE] The code I changed it to was this: [CODE]<script type="text/javascript"> $('.cat').hoverIntent(function(){if($("#sub"+this.id).length){if($(".subcat").is(":visible")){$(".su bcat").hide()}$("#sub"+this.id).slideDown()}else{if($(".subcat").is(":visible")){$(".subcat").slideU p()}}},function(){$(".subcat").slideUp()}) </script>[CODE] |
Since you do not give us the HTML this is effecting it's hard to guess if your doing things right.
I did find some mistakes in the last code. See if this works and if not please post the html: Code:
$('.cat').hoverIntent(function() |
| All times are GMT +1. The time now is 07:41 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.