You can clear all over
classes when handlerIn
.
(function($) {
$(document).ready(function()
{
var $dropdowns = $('li.dropdown');
$dropdowns.hover(function(){
var timer = $(this).data('timer');
if(timer) clearTimeout(timer);
$dropdowns.removeClass('over');
$(this).addClass('over');
},function(){
var li = $(this);
li.data('timer', setTimeout(function(){ li.removeClass('over'); }, 1000));
});
});
})(jQuery);