导航

JQuery 点击DIV以外的元素隐藏DIV

Posted on 2013-10-12 17:40  小强有毒  阅读(196)  评论(0)    收藏  举报
$(function(){ 
  $(document).bind("click",function(e){ 
    var target = $(e.target); 
    if(target.closest(".pop").length == 0){ 
      $(".pop").hide(); 
    } 
  }) 
}) 
<div class="pop"></div>