body 点击事件 排除局部元素
$('body').click(function (e) { if (e.target.className == 'cuttomBtnText' || $(e.target).hasClass('barQrcode') || $(e.target).parents('.barQrcode').length > 0) { return; } // ... });
这个很常用,帮过我的大忙,常常用到的时候找不到。
body 点击事件 排除局部元素
$('body').click(function (e) { if (e.target.className == 'cuttomBtnText' || $(e.target).hasClass('barQrcode') || $(e.target).parents('.barQrcode').length > 0) { return; } // ... });
这个很常用,帮过我的大忙,常常用到的时候找不到。