Extending jquery ui widget - how to access parent event
问题 I'm trying to create a jQuery widget which extends from ui.slider. I'd like to have a custom method which executes on the 'slide' event. I tried overriding the parent's option just like when using the slider widget normally, but I ran into this problem with variable scopes: $.widget( "ui.myslider", $.ui.slider, { _create: function() { this.foo = "bar"; // Outputs "bar" this._mySlide(); // Outputs "undefined" when triggered this.options.slide = this._mySlide; $.ui.slider.prototype._create