沒有任何運氣可以改變幻燈片在fotorama中的時間間隔(時間)。我可以更改過渡時間,但不能更改圖像/幻燈片之間的持續時間。我試着改變data-autoplay =「3000」的間隔,但它沒有做我想要的。這裏是我的代碼:如何減慢或加快jQuery fotorama中幻燈片之間的時間間隔
0
A
回答
-1
數據過渡時間=「1000」
0
不知道這是你在找什麼?我還提供了 How can I set different duration for each fotorama/slide? (not transition duration)
該解決方案如果要更改時間顯示下一張幻燈片之前,對於個人幻燈片......我處理這種方式,通過聽取fotorama.showend事件:
在你的基地JS腳本,包括這一點。 ..我沒有'不會在包含多個照片的頁面上對其進行測試,因此它可能會影響頁面上的所有內容,並且您必須修改這些變量才能定位特定的影音。
$(function() {
$('.fotorama')
/* Listen to the "showend" event... the "show" event is for the beginning of a transition, while "showend" is at the end of the transition. */
.on('fotorama:showend',
function (e, fotorama, extra) {
/* do a switch on the active index + 1, if you want the current frame at base 1 instead of base 0 */
switch (fotorama.activeIndex + 1){
case 2:
fotorama.setOptions({autoplay: 3000});
break;
case 5:
fotorama.setOptions({autoplay: 15000});
break;
case 6:
fotorama.setOptions({autoplay: 7000});
break;
case 7:
fotorama.setOptions({autoplay: 20000});
break;
case 8:
fotorama.setOptions({autoplay: 2000});
break;
default:
/* You could choose to always set the autoplay to a default value here as shown, but it may be more efficient to just always set it back to default on the first slide of a "default duration" sequence (above ex. slide 2 of slides 2-4, or slide 8 of slides 8-the end), instead of setting a new autoplay value on each and every slide regardless of whether or not it's needed. */
fotorama.setOptions({autoplay: 2000});
break;
}
/* see the event fire in developer console, for debugging only */
console.log('## ' + e.type);
console.log('active frame', fotorama.activeFrame);
console.log('additional data', extra);
}
)
});
重要的是要認識到,「show」和「showend」事件是幻燈片專用的,而不是幻燈片專用的。
如果您希望在某些幻燈片結束後更改其他屬性,例如從交叉淡入淡出切換到幻燈片過渡,或者加快或減慢過渡持續時間,這也很方便。
如果你想在一個轉變的開始在一些事情上採取行動,聽「fotorama:秀」 ......事件的完整列表來聽,用控制檯調試代碼從API page:
$(function() {
$('.fotorama')
// Listen to the events
.on('fotorama:ready ' + // Fotorama is fully ready
'fotorama:show ' + // Start of transition to the new frame
'fotorama:showend ' + // End of the show transition
'fotorama:load ' + // Stage image of some frame is loaded
'fotorama:error ' + // Stage image of some frame is broken
'fotorama:startautoplay ' + // Slideshow is started
'fotorama:stopautoplay ' + // Slideshow is stopped
'fotorama:fullscreenenter ' + // Fotorama is fullscreened
'fotorama:fullscreenexit ' + // Fotorama is unfullscreened
'fotorama:loadvideo ' + // Video iframe is loaded
'fotorama:unloadvideo', // Video iframe is removed
function (e, fotorama, extra) {
console.log('## ' + e.type);
console.log('active frame', fotorama.activeFrame);
console.log('additional data', extra);
}
)
// Initialize fotorama manually
.fotorama();
});
相關問題
- 1. 在jQuery幻燈片中恢復間隔
- 2. jquery幻燈片和時間
- 3. 重置幻燈片間隔JQuery
- 4. 簡單的jQuery幻燈片之間幻燈片轉換
- 5. 爲幻燈片重置設置的時間間隔
- 6. 中間圖像之間的互動幻燈片(jQuery?)
- 7. 帶有間隔的Javascript幻燈片
- 8. 如何在jQuery幻燈片中設置每張幻燈片的持續時間?
- 9. Randominze我的幻燈片使用軌道之間的時間
- 10. jQuery幻燈片與每幻燈片轉換/持續時間
- 11. 以特定時間間隔爲kwick製作幻燈片
- 12. jQuery幻燈片放映時間?
- 13. 設置間隔請求幻燈片
- 14. Obj C - 如何使用IKSlideShow自定義幻燈片之間的間隔
- 15. 如何在Jquery Cycle插件中的現有幻燈片之間添加新幻燈片?
- 16. CSS幻燈片(不同的幻燈片時間)
- 17. 如何在兩個或多個幻燈片之間切換?
- 18. jQuery:幻燈片效果/補間幻燈片選項
- 19. 幻燈片放映第一張幻燈片更長時間
- 20. 在我的幻燈片中獲取一張幻燈片以在兩次間隔之間保持較長的時間
- 21. JQuery的Cycle插件 - 延遲間隔幻燈片問題
- 22. jquery幻燈片fadeIn和fadeout與區間
- 23. Flink時間窗和幻燈片時間窗有何不同?
- 24. 我如何爲每個幻燈片/幻燈片設置不同的持續時間? (未轉換時間)
- 25. 如何在JavaScript中減慢和加快時間
- 26. Fotorama過渡時間
- 27. 自定義jQuery幻燈片間隔問題
- 28. bxslider goToSlide()跳過中間的幻燈片
- 29. 每張圖片之間的Bootstrap 3中的空白幻燈片
- 30. 恢復slidingown在幻燈片中間
也許向我們展示你的代碼,以便我們更好地瞭解你在做什麼。 – Jared