4

現在、jquery サイクル プラグインを使用しています。隣同士に座って同時に循環する 3 つの異なるスライドショーがあります。私がやりたいことは、最初のスライドショーを最初にオフに設定し、次に 2 番目、3 番目のスライドショーをオフにすることです。とにかく、インクリメントまたはタイムアウトでこれを行うことができますか?

<div class="cycle" id="one">
   <img src="one.jpg" alt="" />
   <img src="two.jpg" alt="" />
   <img src="three.jpg" alt="" />
</div>
<div class="cycle" id="two">
   <img src="two.jpg" alt="" />
   <img src="three.jpg" alt="" />
   <img src="one.jpg" alt="" />
</div>
<div class="cycle" id="three">
   <img src="three.jpg" alt="" />
   <img src="one.jpg" alt="" />
   <img src="two.jpg" alt="" />
</div>

$('.cycle').cycle({
   fx:'fade',
   speed:1000
});
4

2 に答える 2

3
var timeout = 0;

$(".cycle").each(function () {
   var $this = $(this);
   setTimeout(function () {
      $this.cycle({
         fx: "fade", speed: 1000
      });
   }, timeout);

   timeout += 2000;
});
于 2013-01-21T16:48:36.037 に答える
1
var i = 1;
var x = $(".cycle").length;
var w = setInterval( function() {
if(i==x) {
window.clearInterval(w);
}
else {
$(".cycle:nth-child('+i+')").cycle({
   fx:"fade",
   speed:1000
});
i++;
}
}, 3000);
于 2013-01-21T16:48:43.733 に答える