事件绑定和事件流

示例1:

if(document.all){
   document.attachEvent("onclick",hideDropMenu);
} else {
   document.addEventListener('click',hideDropMenu,true);
}

示例2:

if(document.all) window.event.cancelBubble=true;
else oevent.stopPropagation();

示例3:

if(document.all){
   document.detachEvent("onclick",hideDropMenu);
} else {
   document.removeEventListener('click',hideDropMenu,true);
}

posted on 2008-05-07 12:18  真阿当  阅读(74)  评论(0编辑  收藏  举报