事件冒泡

if(window.event){
    
//cancelBubble的字面意思是取消冒泡
    //如果事件句柄想阻止事件传播到包容对象,必须把该属性设为 true。
    e.cancelBubble = true
else {
    e.preventDefault(); 
//方法取消事件的默认动作
    e.stopPropagation(); //stopPropagation的字面意思是停止传播。 
}

posted @ 2011-06-20 23:55  豪情  阅读(631)  评论(0编辑  收藏  举报