自動スライダーアニメーションのサポートが必要です。つまり、私の質問は、ホバーイベントでアニメーションを停止する方法ですが、別の要素のアニメーションが完全に終了したときにすぐに停止する方法ではありません。
私はこのコードを持っています:
$(function(){
var current_slide=1;
var set_time=2500;
$('span').css({top:'300px'});
$.timer(6000,function(timer){
switch(current_slide){
case 1:
$('span').css({top:'350px'});
$('#slideshow').stop().animate({left:'-960px',top:'0px'},{easing:'easeOutBack',duration:set_time});
current_slide=2;
$('span').delay(2500).animate({top:'300px'});
break;
case 2:
$('span').css({top:'350px'});
$('#slideshow').stop().animate({left:'-1920px',top:'0px'},{easing:'easeOutBack',duration:set_time});
current_slide=3;
$('span').delay(2500).animate({top:'300px'});
break;
case 3:
$('span').css({top:'350px'});
$('#slideshow').stop().animate({left:'-2880px',top:'0px'},{easing:'easeOutBack',duration:set_time});
current_slide=4;
$('span').delay(2500).animate({top:'300px'});
break;
case 4:
$('span').css({top:'350px'});
$('#slideshow').stop().animate({left:'0px',top:'0px'},{easing:'easeOutExpo',duration:set_time});
current_slide=1;
$('span').delay(2500).animate({top:'300px'});
break;
}
timer.reset(12000);
});
$("#slideshow").hover(function(){
$(this).stop(true,true);
});
});
問題は、スライダーにカーソルを合わせると、アニメーションがほとんど、突然、醜く停止した(最後までジャンプした)場合です。.stop()の前にキューを使用する必要があるかもしれません。ここに良い例があります:http : //www.sevtopolishotel.com/事前にTnx!