alptail icon indicating copy to clipboard operation
alptail copied to clipboard

Timer Slider

Open thefubon opened this issue 3 years ago • 1 comments

Please tell me how to add a timer to switch slides in this slider?

thefubon avatar Jun 21 '21 09:06 thefubon

You could do something like this inside of your x-init / init function:

init() {
  setInterval(() => {
    if (this.selected === this.images.length - 1) {
      this.selected = 0
    } else {
      this.selected++
    }
  }, 1000)
}

ryangjchandler avatar Jun 21 '21 09:06 ryangjchandler