galleria auto play slideshow?

末鹿安然 提交于 2019-12-06 13:41:38

问题


Has anyone found an easy way to get the awesome galleria gallery to auto play?

I'm really stuck on this one.

Any help would be great!

Thx Paul


回答1:


$('#galleria').galleria({
    extend: function() {
        this.play(4000); // will advance every 4th second
    }
});

No longer works with the latest version. See below.




回答2:


autoplay: true in the options should do the trick.

autoplay

type: Boolean or Number
default: false

If true, this will start playing the slideshow with 3 seconds interval (default). If you set this to any number, f.ex 4000, it will start playing with that interval (in milliseconds)

My problem is that once it's started, it does not stop when a photo or thumb is clicked.




回答3:


The latest version of galleria has a new way to implement this and I do not believe it is automatically going to scroll unless you implicitly force it to with a setting now.

Also, the issue with the autoplay not stopping after a click is now fixed in the latest version.

<script>
Galleria.loadTheme('../include/scripts/galleria/themes/classic/galleria.classic.min.js');
Galleria.run('#galleria', {
    transition: 'fade',
    imageCrop: true,
    autoplay: 2500 // will move forward every 7 seconds
});          
</script>       



回答4:


According to below documentation, by default you should be getting the behavior you are looking for. Try setting it explicitly.

pauseOnInteraction type: Boolean default: true During playback, Galleria will stop the playback if the user presses thumbnails or any other navigational links. If you dont want this behaviour, set this option to false.



来源:https://stackoverflow.com/questions/2845312/galleria-auto-play-slideshow

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!