点击除指定区域外的空白处,隐藏div

<script>
$(document).click(function (e) {
    var $target = $(e.target);
//点击.zanpl和.quanzipl以外的地方 隐藏.quanzipl和footer
if(!$target.is('.zanpl *') && !$target.is('.quanzipl *')) { 
$(
'.quanzipl').hide();
$(
'footer').show(); }
});

</script>

 

posted @ 2019-06-22 10:35  小锐是梦想家  阅读(380)  评论(0编辑  收藏  举报