How to use 'this' in jQuery plugin callback?
- by Bondye
At the moment I am creating a jQuery plugin.
I am facing a problem when using a callback.
Plugin code
$.fn.bondye = function (options) {
var settings = $.extend({
callback: function () {}
}, options);
return this.each(function () {
$(this).addClass('test');
settings.callback();
});
};
How I want to…