Skip to content

Instantly share code, notes, and snippets.

@Takazudo
Created April 5, 2011 12:17
Show Gist options
  • Save Takazudo/903488 to your computer and use it in GitHub Desktop.
Save Takazudo/903488 to your computer and use it in GitHub Desktop.
jQuery ui widget bind args
$.widget('ui.orewidget', {
...
_create: function(){
this.widgetEventPrefix = 'ore.';
this._eventify();
return this;
},
_eventify: function(){
var self = this;
this.element.bind('click', function(e){
self._trigger('click', e, self._something);
});
return this;
},
...
});
$(function(){
$('#somediv').bind('ore.click', function(e, something){
console.log(e); // is a click event object
console.log(something);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment