Shuffle emits an event when a layout happens and when elements are removed. The event names are Shuffle.EventType.LAYOUT
and Shuffle.EventType.REMOVED
.
Shuffle uses the global CustomEvent
to create events. A polyfill for IE<=11 is bundled with Shuffle.
element.addEventListener(Shuffle.EventType.LAYOUT, function () {
console.log('Things finished moving!');
});
element.addEventListener(Shuffle.EventType.REMOVED, function (evt) {
var detail = evt.detail;
console.log(this, evt, detail.collection, detail.shuffle);
});
Check out the demo at the top of the page, or its JavaScript file.