1.在onclick事件中加return false來阻止冒泡:
代碼如下:
$("a").click(function(){
window.location.href = "xxx.html";
reutrn false;
})
2.延遲100毫秒
setTimeout(function(){
},100);