You can create and clear a 2 second timer, for example:
$("a.menu-arrow").hover(function() { $.data(this, "timer", setTimeout($.proxy(function() { $(this).click(); }, this), 2000)); }, function() { clearTimeout($.data(this, "timer")); });
You can try it here . Using $.data() , we save a timeout for each item to avoid any problems and clear the correct timer. The rest simply sets a 2-second timer when entering an item and clearing it when exiting. Therefore, if you stay for 2000 ms, it runs .click() , if you leave it, it stops clearing the timer.
Nick craver
source share