没有任何运气可以改变幻灯片在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