krisk / textualizer

A jQuery plug-in which transitions through blurbs of text, animating each character
http://krisk.github.io/textualizer/
341 stars 40 forks source link

Feature Request: Callback events #6

Closed joshbrown closed 12 years ago

joshbrown commented 12 years ago

Hey everyone. Just wanted to put this out there and see if anyone wanted to fork and collaborate on adding callback functions. Or if @krisk has plans to add this feature.

One specific callback: when the plugin has reached the last array element.

krisk commented 12 years ago

Actually, I never thought about it. I suppose that events such as cycle begin/end could be useful. Or perhaps something more generic, such as a callback function that is triggered on every item change, and gives the current index. So essentially you would be able to do something like:

var txt = $(something).textualizer();

txt.bind('change', function(index) {
  if (index === MY_LAST_ARRAY_INDEX) {
    // Last item reached
  }
});

Thoughts?