事件监听
function addEvent(target,type,handler) { if(target.addEventListener){ target.addEventListener(type,handler,false) }else { target.attachEvent("on"+type, function (event) { return handler.call(target,event) } ) } }
取消默认事件
function cancelHandler(event) { var event = event || window.event; if(event.preventDefault){event.preventDefault();} if(event.returnValue){event.returnValue = false;} return false; }