ryanflorence / jquery-rf-slideshow

Super flexible, low-level jQuery slideshow built on the jquery.widget system
60 stars 4 forks source link

showComplete Callback #2

Closed iammerrick closed 13 years ago

iammerrick commented 13 years ago

The showComplete callback is all over the documentation but is never actually triggered in the widget, so far as I can tell.

ryanflorence commented 13 years ago

$.widget's event system is my biggest criticism. I may have documented the wrong name, it's just 'complete' but the widget factory does a few things to it.

Do it like this:

$('#el').slideshow({
  complete: function (params){
    // do stuff
  }
});

// add it after instantiation
$('#el').bind('slideshowcomplete', fn); // ugh

You can see how I use it in slideshownav: https://github.com/rpflorence/jquery-rf-slideshow/blob/master/src/jquery.rf.slideshownav.js#L45-61

Unlike MooTools, widgets don't have their own events, it's all routed through the element.

ryanflorence commented 13 years ago

Yep, docs say "showcomplete" when its' just "complete".