Last active
September 4, 2015 12:14
-
-
Save iwill/320652 to your computer and use it in GitHub Desktop.
$.addEventType & $.fn.addEventType
This file contains hidden or 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
/*! | |
* jQuery plugin - jquery.addEventType.js v1.0 | |
* http://github.com/iwill/ | |
*/ | |
(function($) { | |
$.addEventType = $.fn.addEventType = function(eventType) { | |
(this.fn || this)[eventType] = function(handler) { | |
return handler ? this.bind(eventType, handler) : this.trigger(eventType); | |
}; | |
return this; | |
}; | |
})(jQuery); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment