Skip to content

Instantly share code, notes, and snippets.

@yckart
Created December 2, 2012 23:58
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save yckart/4191657 to your computer and use it in GitHub Desktop.
Save yckart/4191657 to your computer and use it in GitHub Desktop.
jQuery function to allow multiple events via `on`-event on one element with different functions and target selectors
;(function($) {
$.fn.act = function() {
var args = arguments;
return this.each(function() {
for (var i = args.length; i--;) {
$(this).on(args[i][0], args[i][1], args[i][2]);
}
});
};
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment