View Single Post
Old 02-22-2013, 08:11 AM   PM User | #1
mbmwl
New to the CF scene

 
Join Date: Feb 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
mbmwl is an unknown quantity at this point
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]
mbmwl is offline   Reply With Quote