画廊自动播放幻灯片?

发布于 2024-09-02 02:59:30 字数 82 浏览 3 评论 0原文

有没有人找到一种简单的方法来让很棒的画廊自动播放?

我真的被这个困住了。

任何帮助都会很棒!

谢谢保罗

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

征﹌骨岁月お 2024-09-09 02:59:30

自动播放:真
在选项中应该可以解决问题。

自动播放

类型:布尔值或数字
默认值:假

如果为 true,这将开始播放
间隔 3 秒的幻灯片
(默认)。如果您将其设置为任何
编号,f.ex 4000,它将启动
以该间隔进行演奏(在
毫秒)

我的问题是,一旦开始,单击照片或拇指时它就不会停止。

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.

思念满溢 2024-09-09 02:59:30

最新版本的 Galleria 有一种新的方法来实现这一点,我不相信它会自动滚动,除非你现在隐式地强制它进行设置。

此外,点击后自动播放不会停止的问题现已在最新版本中修复。

<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>       

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>       
℡Ms空城旧梦 2024-09-09 02:59:30
$('#galleria').galleria({
    extend: function() {
        this.play(4000); // will advance every 4th second
    }
});

不再适用于最新版本。见下文。

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

No longer works with the latest version. See below.

尬尬 2024-09-09 02:59:30

根据下面的文档,默认情况下您应该获得您正在寻找的行为。尝试明确设置它。

交互暂停
类型:布尔值
默认值:true
在播放期间,如果用户按缩略图或任何其他导航链接,Galleria 将停止播放。如果您不希望出现此行为,请将此选项设置为 false。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文