$("#元素").bind("click",function(e){ if($(e.target).closest("#元素").length == 0){ 方法(); } });
点击元素外的元素,触发方法
$("#元素").bind("click",function(e){ if($(e.target).closest("#元素").length == 0){ 方法(); } });
点击元素外的元素,触发方法
转载于:https://my.oschina.net/u/3040505/blog/1617224