TinSlide 0.1.19

Events

Events is a work in progress

The only event currently implemented is the itemSelected event. It is dispatched every time a new item becomes the selected item. In TinSlide, the selected item is the item closest to be "in position". It is not necessarily the same as the targeted item – which the slider animates towards. However, the targeted item will eventually become the selected one.

var tinSlide = TinSlide(document.getElementById('slider'));
tinSlide.on('itemSelected', function(event) {
  document.getElementById('slider-info').innerText = event.index;
});

Selected index: 0