Skip to content

Commit

Permalink
Merge pull request #240 from karolk/zepto
Browse files Browse the repository at this point in the history
---

This adds around 300b to the library size but provides support for $.click and other popular events. This is based on jQuery but simplify because Zepto isnt trying to pass data with events.
  • Loading branch information
madrobby committed Jul 29, 2011
2 parents da3a132 + a84bb26 commit 50f802b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/event.js
Expand Up @@ -122,6 +122,11 @@
this.dispatchEvent(event);
});
};

//add support to all events supported with jQuery which are simple wrappers for native events
("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error").split(" ").forEach(function(e) {
$.fn[e] = function(callback){ return this.bind(e, callback) }
});

$.Event = function(src, props) {
var event = document.createEvent('Events');
Expand Down

0 comments on commit 50f802b

Please sign in to comment.