Created
April 13, 2011 13:44
-
-
Save gregorymostizky/917568 to your computer and use it in GitHub Desktop.
Bind and trigger custom events for specific element
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
var self = $('#mydiv'); | |
// define | |
self.unbind('my-event'); | |
self.bind('my-event', function() {alert('yes')}); | |
// trigger | |
self.trigger('my-event'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment