1、在内部的点击事件的方法中加入event.stopPropagation(); 可以阻止外部点击事件。
eg:
<div id='outSide' onclick='clickOutSide()'>
<span>look at here</span>
<div id='inSide' onclick='clickInSide()'>
<span> what will happen</span>
</div>
</div>
<script>
function clickOutSide(){
alert("you are just clicking the outside div");
}
function clickInSide(){
event.stopPropagation();
alert("you are just want to click the inside div");
}
</script>