brutaldesign/swipebox — pull request #64 by hsubu (2013-10-09 08:35:05+00:00)
Title: Trigger custom events on slide request and slide completion, to allow fo...

...r callbacks

In order to allow for custom callbacks to be setup on event listeners, I created 'slide' and 'slid' events. Slide fires as soon as the next/previous slide is requested, and 'slid' fires after it's completed (which isn't totally accurate in the case of CSS animation, as the timing can vary).

The 'slide' event passes:
event,
direction ('next' or 'prev'),
element (the data that will feed the next slide)

The 'slid' event passes:
event,
direction,
$nextSlide (the jQuery object of the slide that is becoming active)