Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- addEvent : function(el, type, fn) {
- if (typeof addEventListener !== "undefined") {
- el.addEventListener(type, fn, false);
- } else if (typeof attachEvent !== "undefined") {
- el.attachEvent("on" + type, fn);
- } else {
- el["on" + type] = fn;
- }
- }
Add Comment
Please, Sign In to add comment