您的位置:首页 > Web前端 > JQuery

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

2013-10-12 17:40 986 查看
$(function(){
  $(document).bind("click",function(e){
    var target = $(e.target);
    if(target.closest(".pop").length == 0){
      $(".pop").hide();
    }
  })
})


<div class="pop"></div>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: