Skip to content

Instantly share code, notes, and snippets.

@remy
Created December 13, 2009 03:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save remy/255247 to your computer and use it in GitHub Desktop.
Save remy/255247 to your computer and use it in GitHub Desktop.
var e = "touchstart touchmove touchend".split(' '),
i = e.length,
method = '';
while(i--) {
(function (method) { // method is now private
$.fn[method] = function (fn) {
return fn ?
this.bind(method, fn) :
this.trigger(method);
};
})(e[i]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment