textualizer
textualizer copied to clipboard
onComplete and onTriggered
Can you implement the onComplete event? It would be very useful in order to execute some javascript when the animation has finished.
Also, an OnTriggered (or equivalent name) event would be useful to know when the animation begins. thanks
Although undocumented, right now it does trigger an event when a blurb changes.
var txt = $(something).textualizer();
txt.on('textualzer.blurbchanged', function(index) { ... });
Thus, to know when you've reached the last item, you can do something like
txt.on('textualzer.blurbchanged', function(index) {
if (index === WHATEVER_YOUR_LAST_ARRAY_INDEX_IS) {
// Last item reached
// Do something
}
});
You can leverage the above code (or variants of it), to determine when an animation begins, ends, etc.