Created
April 5, 2011 12:17
-
-
Save Takazudo/903488 to your computer and use it in GitHub Desktop.
jQuery ui widget bind args
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.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