jQuery如何阻止事件冒泡:
事件冒泡现象有时候能够起到很大的作用,有时候也会干扰操作,下面就介绍一下jQuery如何阻止事件冒泡现象。
阻止事件冒泡可以有两种方式,列举如下:
解决方案一:
$("#thediv").mousedown(function(event){ event.stopPropagation(); //其他代码 });
解决方案二:
$("#thediv").mousedown(function(event){ return false; //其他代码 });
原文地址是:http://www.softwhy.com/forum.php?mod=viewthread&tid=10660
更多内容可以参阅:http://www.softwhy.com/jquery/