/**
* @description event binding, compatible with all browsers
* @param target event trigger object
* @param type event
* @param func event processing function
*/
function addEvents(target , type, func) {
if (target.addEventListener) //Not ie and ie9
target.addEventListener(type, func, false);
else if (target.attachEvent) //ie6 to ie8
target.attachEvent("on" type, func);
else target["on" type] = func; //ie5
};
/**
* @description event removal, compatible with all browsers
* @param target event trigger object
* @param type event
* @param func event handler function
*/
function removeEvents(target, type, func ){
if (target.removeEventListener)
target.removeEventListener(type, func, false);
else if (target.detachEvent)
target.detachEvent("on" type, func);
else target["on" type] = null;
};