lukeed / bee3d

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

How do I know the slide that I haveto load via Ajax? #63

Closed OscarWilde closed 6 years ago

OscarWilde commented 6 years ago

I've got many slides to load and I need to know at what slide I am to load the correct one. How do I do that?

lukeed commented 6 years ago

Hey,

The AJAX solution is not the most elegant thing in the world... I need to update it 🙈

For now, you can update your options on every slide change:

var slider = new Bee3D(elem, options);

slider.el.on('activate', function(event) {
  console.log('This is the activated index: ', event.index);
  // do something based on the new index?
  slider.options.ajax.path = `/api/posts?offset=${event.index}`;
  // ^ update the AJAX path (bad example)
});