galleria auto play slideshow?

2019-04-14 03:33发布

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

4条回答
Viruses.
2楼-- · 2019-04-14 04:04
$('#galleria').galleria({
    extend: function() {
        this.play(4000); // will advance every 4th second
    }
});

No longer works with the latest version. See below.

查看更多
劳资没心,怎么记你
3楼-- · 2019-04-14 04:05

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.

查看更多
兄弟一词,经得起流年.
4楼-- · 2019-04-14 04:13

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.

查看更多
爷、活的狠高调
5楼-- · 2019-04-14 04:25

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>       
查看更多
登录 后发表回答