javascript 如何动态的加监听事件(window.attachEvent) 函数:
function estoreMap(){
if (window.addEventListener){
window.addEventListener('resize',onResize,false);
}else if (window.attachEvent){
window.attachEvent('onresize',onResize);
}
}
function mianButtonBigMap(){
if (window.addEventListener){
window.addEventListener('resize',onResizeBig, false);
}else if (window.attachEvent){
window.attachEvent('onresize',onResizeBig);
}
}
描述:
当上面两个函数相互切换时,始终保持只有一个监听,也就是说如何删除window.attachEvent?