2011-05-19 87 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