JQuery中阻止事件冒泡,什么是冒泡 ,冒泡是什么,如何阻止冒泡
冒泡是一个八卦的人的写真 就是无论与她有没有关系她都会去八卦一下
下面的列子是抄别人的
方式一:event.stopPropagation();
$("#div1").mousedown(function(event){
event.stopPropagation();
});
方式二:return false;
$("#div1").mousedown(function(event){
return false;
});
冒泡是一个八卦的人的写真 就是无论与她有没有关系她都会去八卦一下
下面的列子是抄别人的
方式一:event.stopPropagation();
$("#div1").mousedown(function(event){
event.stopPropagation();
});
方式二:return false;
$("#div1").mousedown(function(event){
return false;
});