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)