我有时会遇到鼠标悬停问题,当我将鼠标快速移动到链接上时,它会循环很长一段时间,有没有办法只在鼠标悬停时才循环,如果鼠标不在则停止。
$('ul.display li').hover(function() {
$('ul.display li').find('#details').hide(); // hides all deatils div before showing
$('#light').delay('800').fadeIn("fast"); // shows div that fades out all other content.
if($.cookie("switch_thumb") =="thumb_view" || $.cookie("switch_thumb") =="null"){//checks for cookie set for display type
$(this).find('#details').delay('900').animate({width:'toggle'}); // grow width
}else{
$(this).find('#details').delay('900').animate({height:'toggle'}); // grow height
}
}, function() {
$('#light').fadeOut("fast"); // dim the light to show all content
$('ul.display li').find('#details').hide(); //hide all details
return false; // supposed to stop looping.
});