function stopPropagation(e) { e = e || window.event; if(e.stopPropagation) { //W3C阻止冒泡方法 e.stopPropagation(); } else { e.cancelBubble = true; //IE阻止冒泡方法 } }
box2.οnmοuseοver=function(e){ console.log(22); stopPropagation(e); }
本文共 340 字,大约阅读时间需要 1 分钟。
function stopPropagation(e) { e = e || window.event; if(e.stopPropagation) { //W3C阻止冒泡方法 e.stopPropagation(); } else { e.cancelBubble = true; //IE阻止冒泡方法 } }
box2.οnmοuseοver=function(e){ console.log(22); stopPropagation(e); }
转载于:https://www.cnblogs.com/shimily/articles/4569859.html