Shopify themes, liquid, logos, and UX
Hi - I have added the following code to custom.js to allow my slideshow to autoplay. But I would like it to stop looping (i.e. autoplay stops after 1 cycle). How can I do this? Thanks 🙂
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');}, 2000)};sections.extend('slideshow', slideshowAutoExtension);
User | RANK |
---|---|
72 | |
65 | |
55 | |
54 | |
42 |
As a business owner, have you ever wondered when your customer's first impression of yo...
By Skye Jun 6, 2023We're excited to announce improvements to the threaded messaging experience in our communi...
By TyW May 31, 2023Thank you to everyone who participated in our AMA with Klaviyo. It was great to see so man...
By Jacqui May 30, 2023