lukeed / bee3d

Support Forum for Bee3D Slider, found @ http://www.lukeed.com/demo/bee3D
MIT License
7 stars 2 forks source link

How to enable autoplay manually? #48

Closed mrdubz closed 7 years ago

mrdubz commented 7 years ago

Hi! I have slider with 'autoplay: false', but i need start autoplay manually by event in other script. Is it possible?

Thanx!

lukeed commented 7 years ago

Hello, Yes! Simply call the autoplay() function on your slider.

var element = document.querySelector('.example');

var slider = new Bee3D(element, {
  effect: 'carousel',
  listeners: {
    keys: true
  },
  navigation: {
    enabled: true
  }
});

// later...

slider.autoplay();

You can set the autoplay.speed value ahead of time & it will be used whenever you decide to begin autoplaying.

Let me know if that helps 😃