我在#next #prev導航和圖像計數器輸出的幾個圖庫中使用jQuery循環。jQuery Cycle - #next #prev,在currentGallery的最終幻燈片後轉到nextGallery
現在我試圖將所有這些畫廊連接在一起。如果用戶到達圖庫A(galleryA.html)的最後一張幻燈片,則#next錨點應該指向圖庫B(galleryB.html)/ #prev錨點應該指向圖庫C(galleryC.html)。
如何結合我的2個功能來做到這一點?
// slideshow fx $(function() { $('#slideshow').cycle({ fx: 'fade', speed: 350, prev: '#prev', next: '#next', timeout: 0, after: onAfter }); }); //image counter output function onAfter(curr,next,opts) { var caption = (opts.currSlide + 1) + opts.slideCount; $('#counter').html(caption); }
HTML:
<div id="slideshow-container">
<div class="slideshow-nav"><a id="prev" href=""></a></div>
<div class="slideshow-nav"><a id="next" href=""></a></div>
<div id="slideshow" class="pics">
<img src="galleryA/01.jpg" />
<img src="galleryA/02.jpg" />
<img src="galleryA/03.jpg" />
<img src="galleryA/04.jpg" />
<img src="galleryA/05.jpg" />
<img src="galleryA/06.jpg" />
</div>
</div>
感謝您的提示。我會嘗試所有可能的方式,我可以提出。 jQuery的週期設有一個結束選項: 結束日期null,//調用的回調時,幻燈片終止(帶自動停止或NOWRAP選項使用):功能(選擇) 我想我的麻煩,因爲我試圖旋轉withing圖像組和畫廊,所以#prev和#next錨點做兩件事,在一組圖片中旋轉,當到達最後(在任何一邊!)將轉到下一個或prev畫廊。 – FHP 2010-04-20 13:06:38