首页 > 代码库 > Js 冒泡事件阻止

Js 冒泡事件阻止

 var event = arguments.callee.caller.arguments[0] || event;  //获取事件对象本身


        if (event.stopPropagation) { //是火狐浏览器时
            // this code is for Mozilla and Opera
            event.stopPropagation();
        }
        else if (window.event) { //是IE浏览器时
            // this code is for IE
            window.event.cancelBubble = true;
  }

Js 冒泡事件阻止