Creating a custom jQuery widget:
jQuery.widget("ui.test",{
_init: function(){
$(this.element).click(this.showPoint);
},
showPoint: function(E){
E.stopPropagation();
alert(this.options.dir);
}
}
Initializing the custom widget:
$('#someEleme').test();
The current implementation of the options
object in the showPoint event handler lacks definition. What is the correct method to pass this value within a jQuery widget?