I'm using Brian Cherne's hoverIntent.js
plugin for a project. It's a great plugin but it seems to be broken in jQuery 1.7.1.
I'm trying to debug it but I'm not the most ace javascripter out there. Can anyone tell me what I might need to look for in his code to fix the following error message:
Uncaught TypeError: Cannot call method 'apply' of undefined
That's what my Chrome console tells me. I'm just not sure what to change.
There is the following line of code in the plugin which contains apply
in the string
return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};
EDIT
I should post the link to Brian's full commented code. It's here: http://cherne.net/brian/resources/jquery.hoverIntent.js
EDIT 2
My script is as follows
//#nav-main dropdown effects
$('#nav-main ul li').hoverIntent(function () {
$(this).find('.dropdown').stop(true,true).slideToggle('500');
});
Basically hoverIntent requires two functions or one object.
If you put in just one function, it will try to use your function as object and you can't apply a function! So use:
$('#nav-main ul li').hoverIntent(function () {
$(this).find('.dropdown').stop(true,true).slideToggle('500');
}, function(){});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With