(function($){ $.fn.hoverdelay = function(options){ var defaults = { hoverduring: 200, outduring: 200, hoverevent: function(){ $.noop(); }, outevent: function(){ $.noop(); } }; var sets = $.extend(defaults,options || {}); var hovertimer, outtimer, that = this; return $(this).each(function(){ $(this).hover(function(){ cleartimeout(outtimer); hovertimer = settimeout(function(){sets.hoverevent.apply(that)}, sets.hoverduring); },function(){ cleartimeout(hovertimer); outtimer = settimeout(function(){sets.outevent.apply(that)}, sets.outduring); }); }); } })(jquery);