Please Help me - IE 6,7,8 Out of Memory Error on drop menu
I'm new to JQuery and I receive an out of memory error when I roll over and off, over and off my menu 6 times. I'm using the latest version of JQuery. Maybe there is something I'm missing. Any help will VERY much be welcomed.
-
/*
hoverIntent Menu Config
*/
var menuConfig = {
sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)
interval: 200, // number = milliseconds of polling interval
over: showNav, // function = onMouseOver callback (required)
timeout: 500, // number = milliseconds delay before onMouseOut function call
out: hideNav // function = onMouseOut callback (required)
}
function showNav(){
var menu = $(this).attr('id');
var smenu = $('#menu_' + $(this).attr('id'));
smenu.slideDown("fast");
$(this).addClass("active");
smenu.data("mouse","off");
smenu.mouseover(function() {
smenu.data("mouse","hover");
smenu.hover(function(){return false;},
function(){
$('#' + menu).removeClass("active");
smenu.fadeOut("fast");
return false;
});
});
}
function hideNav(){
var menu = $(this).attr('id');
var smenu = $('#menu_' + $(this).attr('id'));
if (smenu.data("mouse") == "off") {
$('#' + menu).removeClass("active");
smenu.fadeOut("fast");
}
}
/*
Menu Items
*/
$(function(){
$('#MenuItem')
.css( {backgroundPosition: "0 -35px"} )
.mouseover(function(){
$(this).stop().animate({backgroundPosition:"(0 0)"}, {duration:400})
})
.hoverIntent(menuConfig)
.mouseout(function(){
$(this).stop().animate({backgroundPosition:"(0 0)"}, {duration:300, complete:function(){
$(this).css({backgroundPosition: "0 -35px"})
}})
})