/**
事件工具
*/
var EventUtil = {
addHandler : function(element, type, handler) {
if (element.addEventListener) {
//for ie9+
element.addEventListener(type, handler, false);
} else if (element.attachEvent) {
//for ie8-
element.attachEvent("on" + type, handler);
} else {
element["on" + type] = handler;
}
},
removeHandler : function(element, type, handler) {
if (element.removeEventListener) {
//for ie9+
element.removeEventListener(type, handler, false);
} else if (element.detachEvent) {
//for ie8-
element.detachEvent("on" + type, handler);
} else {
element["on" + type] = null;
}
}
};