function addEvent(obj, type, handle) {
    if (obj.addEventListener) {
        obj.addEventListener(type, handle);
    } else if (obj.attachEvent) {
        obj.attachEvent('on' + type, handle);
    }
}
function removeEvent(obj, type, handle) {
    if (obj.removeEventListener) {
        obj.removeEventListener(type, handle);
    } else if (obj.detachEvent) {
        obj.detachEvent('on' + type, handle);
    }
}

  

posted on 2019-05-27 16:48  默西塞德  阅读(264)  评论(0编辑  收藏  举报