标签:
//跨浏览器事件处理程序 var eventUtil = { //添加句柄 addHandler:function(element,type,handle){ if(element.addEventListener){ element.addEventListener(type,handle,false); }else if(element.attachEvent){ element.attachEvent(‘on‘+type,handle); }else{ element[‘on‘ + type] = handle; } }, removeHandler:function(element,type,handle){ if(element.removeEventListener){ element.removeEventListener(type,handle,false); }else if(element.detachEvent){ element.detachEvent(‘on‘+type,handle); }else{ element[‘on‘ + type] = null; } } }
标签:
原文地址:http://www.cnblogs.com/lucyyuan/p/5087341.html