nathansearles / slidesjs

SlidesJS is obsolete and no longer maintained.
https://nathansearles.github.io/slidesjs/
1.72k stars 357 forks source link

Make API access available in callback loaded #567

Open thinsoldier opened 10 years ago

thinsoldier commented 10 years ago

As it is right now, the only way I can find to access the api (play, stop, next, prev, goto, etc) is by getting it from the data attribute the plugin creates on the original element containing the slides.

sjsApi = $('#slides').data('plugin_slidesjs');

But this data attribute does not yet exist at the time when the loaded callback occurs, so there is no way to access the api from within a callback function.

BillyNate commented 10 years ago

Is it just me, or is the $(this) not correctly accessible in the callback functions anyway? (THIS seems to be the plugin, not a DOM element)