浏览器兼容:取消冒泡事件

       function cancelEvent(evt){
            if (window.event) {
                window.event.cancelBubble =true;
            }else{
                evt.stopPropagation();
            }
        }

event在firefox浏览器中是局部变量,所以必须要通过参数的方式传递到相应的方法中。



原文地址:https://www.cnblogs.com/yumianhu/p/3710747.html