幻灯片自动播放空白,然后以 Shopify 叙事主题结束

问题描述

我希望在叙事主题自动播放幻灯片效果很好,尽管在自动播放幻灯片结束时,它会在重新启动之前挂在空白幻灯片上很长一段时间。我怎样才能删除它并使它向右滑动到第一张图像而不是显示空白。任何帮助都会很棒。我将此代码输入 custom.js

var sections = window.theme.sections;
var slideshowAutoExtension = {
  init: function() {
    this.on('slideshow_desktop_init_done',this._autoplaySlideshow.bind(this));
  },_autoplaySlideshow: setInterval(function() {
    var $slide = $('.slideshow__slide--active')
                   .removeClass('slideshow__slide--active');

    var $button = $('.slideshow__button--active')
                   .removeClass('slideshow__button--active');

    var $slides = $('.slideshow__slide');

    var currentIndex = ($slides.index($slide) + 1) % $slides.length;

    $slides
      .eq(currentIndex)
      .addClass('slideshow__slide--active');

    var $buttons = $('.slideshow__button')
      .eq(currentIndex)
      .addClass('slideshow__button--active');

  },5000)

};

'''

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)