HoverIntent Config, Not Picking Up

163 Views Asked by At

I've used hoverIntent before but it doesn't seem to be working on this site, here is the config:

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.hoverintent/1.9.0/jquery.hoverIntent.js"></script>    
var config = {
  sensitivity: 1000000000000000,
  interval: 1000000000000000,
  timeout: 1000000000000000
};

jQuery('.left-menu-items li').hoverIntent(function() {
  jQuery(this).find('.sub-sub-menu-items').first().css({
    'display': 'block'
  });
}, function() {
  jQuery(this).find('.sub-sub-menu-items').first().css({
    'display': 'none'
  });
}, config);

Am I missing something? It doesn't seem to listen to the config. I'm using jQuery 1.11.3

1

There are 1 best solutions below

1
WebDevB On

I've managed to fix this, it looks like the above code will only work with an older version of hoverIntent, looks like R5 version.

This code below, works with the current version of hoverIntent:

jQuery(".left-menu-items li").hoverIntent({
    over: function () {
        jQuery(this).find('.sub-sub-menu-items').first().show()
    },
    out: function () {
        jQuery(this).find('.sub-sub-menu-items').first().hide()
    },
    timeout: 700,
    sensitivity: 10
});