jQuery动画方法未停止
这是我制作动画幻灯片的简单代码。它应该做两件事: -首先是“鼠标”事件-它反弹“拇指”图像 -第二个-显示并反弹缩略图的较大图像jQuery动画方法未停止,jquery,jquery-ui,Jquery,Jquery Ui,这是我制作动画幻灯片的简单代码。它应该做两件事: -首先是“鼠标”事件-它反弹“拇指”图像 -第二个-显示并反弹缩略图的较大图像 $('img.thumb').mouseover(function (){ $(this).effect('bounce', 500, function(){ var src = 'images/screens/' + $(this).attr('id').substr(0,1) + '.jpg'; $('.slideShow
$('img.thumb').mouseover(function (){
$(this).effect('bounce', 500, function(){
var src = 'images/screens/' + $(this).attr('id').substr(0,1) + '.jpg';
$('.slideShow img').attr('src' ,src);
$('.slideShow img').toggle('bounce').css('margin-top','2.5%');
});
});
$('img.thumb').mouseleave(function (){
$('.slideShow img').fadeOut();
});
问题是,它在谷歌Chrome上运行得非常完美,但在Firefox和IE上却表现得非常疯狂:拇指图像不断反弹,而更大的图像不断出现和消失
这里的诀窍是什么?根据我从您的帖子中了解到的,我认为Jquery工具提示小部件是您在自定义动画中寻找的:
这符合您的要求吗?在鼠标上方尝试setTimeOut()函数是哪一个,
mouseenter
(在代码上方的注释中)还是mouseover
(在代码中)?我认为问题在于,它在鼠标结束的整个时间内设置动画。相反,请尝试使用mouseenter,这样它只会执行一次该场景。否。这没什么区别。即使我换成“鼠标器”,问题仍然存在
$('img.thumb').mouseover(function (){
$(this).effect('bounce', 500, function(){
var src = 'images/screens/' + $(this).attr('id').substr(0,1) + '.jpg';
$('.slideShow img').attr('src' ,src);
$('.slideShow img').css('margin-top','2.5%');
});
});
$('img.thumb').mouseleave(function (){
$('.slideShow img').fadeOut();
});