@Gasperpremoze
- Click Online Store and then Themes.
- Next, click on the Actions drop-down.
- From the drop-down, select **Edit Code (**as shown here).
- Find the Assets folder and then open up the custom.js file.
- Once you open the custom.js file, you will just need to copy and paste the below code. Here is a quick screenshot to show you where to paste the code.
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');
}, 1000)
};
sections.extend('slideshow', slideshowAutoExtension);
1 Like