0
我有一個jQuery腳本,它需要一個img src,將src放在隱藏的div中,並在懸停請求img時用動畫放大img。但是,當我從img跳到img時,clearQueue
或stop
不能按需使用。jQuery中的clearQueue
在這個示例中,當我從img緩慢跳到另一個img時,它工作正常,但是當我快速跳轉時,img在img和img之間完全消失。
我想要的只是能夠快速或緩慢地從img移動到img,並且不會留下任何隊列。
如果有人能幫助我,我會很高興。
下面是代碼:
$(document).ready(function(){
$(".thumb").hover(function(e) {
$('#popm').css('left',e.pageX+50);
$('#popm').css('top', e.pageY+50);
e.preventDefault();
var src= $(this).attr("src");
$('.popimg').attr({"src": src});
$('#popm').stop().fadeIn(100);
$('.popimg').stop()
.animate({
width: '145px', /* Set new width */
height: '145px' /* Set new height */
}, 200);
}, function() {
$('#popm').stop().fadeOut(100);
$('.popimg').stop()
.animate({
width: '45px', /* Set new width */
height: '45px' /* Set new height */
}, 200);
});
});
tnx mate it works – user973378