Codeinwp / Nivo-Slider-jQuery

Nivo Slider - The Most Awesome jQuery Image Slider
http://docs.themeisle.com/article/485-getting-started-with-the-nivo-slider-jquery-plugin
MIT License
1.25k stars 605 forks source link

Container and parameters are not arguments in callbacks #389

Open lucasmahle opened 9 years ago

lucasmahle commented 9 years ago

There is no way to make an interaction or extension in callbacks unable to access the container and options scope. Changing the code and passing "element" and "settings" as a parameter in the callbacks I could extend the plugin and personalizing with my need. Without these two parameters, callbacks are stuck.

Line 302 of jquery.nivo.slider.js;

//settings.beforeChange.call(this);
settings.beforeChange.call(this, element, settings);

My code:

beforeChange: function(container, options){
    self = $(container);

    zero     = -55;
    hundred  = 0;

    start   = 0;
    end     = options.pauseTime;

    // Animation...
}