2011-05-19 86 views
0

所以我有jQuery循环运行,我需要帮助如何设置参数,以便幻灯片循环一次,然后开始回到第一个位置,只是停止。我有滚动图像的文字。现在,我可以得到图像循环回穿上“结束”的功能,但是当我这样做的一个文本没有激活,这是我的参数设置:jquery循环:幻灯片循环一次后,重新启动一个,并停止

$.fn.cycle.defaults = { 
    fx:   'fade', // one of: fade, shuffle, zoom, scrollLeft, etc 
    timeout:  4000, // milliseconds between slide transitions (0 to disable auto 
    speed:   4000, // speed of the transition (any valid fx speed value) 
    pagerEvent: 'hover', // event which drives the pager navigation 
    end: function() {$('#slideshow').cycle('next'); }, 
    sync:   1,  // true if in/out transitions should occur simultaneously 
    nowrap:  1  // true to prevent slideshow from wrapping 

}; 

有谁知道是谁拿到周期只运行一次,然后跳回到一个,然后停止,再次激活链接?我尝试过使用autostop和autoStopCount,但我不想指出一个确切的数字来使它停止。非常感激任何的帮助。

回答

3

请参阅http://jquery.malsup.com/cycle/end.html并试试这个或类似的东西。

$('#slideshow').cycle({ 
    autostop: 1, 
    end:  function(options) { 
     $('#slideshow').cycle(0).cycle('stop'); 
    } 
}); 
+0

我试过使用此代码,并得到了一个奇怪的结果。幻灯片放映会沿着最后一张幻灯片停止,然后导航会继续生成活动的第一张幻灯片标志,即使实际的幻灯片本身在最后一张幻灯片上保持暂停状态。有任何想法吗? – norsewulf 2013-01-15 19:17:28

+0

这个答案解决了让循环通过幻灯片一次并再次停止在第一张幻灯片上的问题。请接受。 – Emanegux 2013-04-19 13:02:17