Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delay with hoverintent

var config = {    
     sensitivity: 3,    
     interval: 5000,     
     timeout: 5000,    
};

$("#cart-summary").hoverIntent(function () {
        $('.flycart').slideDown('fast');
}, function() {
        $('.flycart').slideUp('fast');
}).find('a.close').click(function(){
   $(this).parents('.flycart').hide();
});

...this works, but two issues:

  1. It doesn't seem to wait 5 seconds like it should, opens almost instantly no matter what I Set.

  2. Affects all elements using the hoverintent plugin on the same page.

I'd really appreciate any help. Thanks!

like image 688
eozzy Avatar asked Oct 02 '09 17:10

eozzy


1 Answers

You're not passing the config object to hoverIntent, so it's using defaults: http://cherne.net/brian/resources/jquery.hoverIntent.html

To clarify,

var config = {
     sensitivity: 3,
     interval: 5000,
     timeout: 5000
};

$("#cart-summary").hoverIntent(function () {
    $('.flycart').slideDown('fast');
}, function() {
    $('.flycart').slideUp('fast');
}).find('a.close').click(function () {
    $(this).parents('.flycart').hide();
}, config);
like image 112
lod3n Avatar answered Nov 11 '22 08:11

lod3n