jsingleegg

css部分:

<style type="text/css">
.pop { width:200px; height:130px; background:#080;}
</style>

样式与JS部分:

<body>
  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
  <script type="text/javascript">
    $(function(){
 

      $(document).bind("click",function(e){
          var target  = $(e.target);
          if(target.closest(".pop").length == 0){
               $(".pop").hide();
            }    
       })
    })
  </script>

<div class="pop"></div>

点击空白的地方指定div 隐藏消失了
</body>

 

分类:

技术点:

相关文章:

  • 2021-12-15
  • 2021-09-25
  • 2021-09-27
  • 2021-09-27
  • 2021-12-15
  • 2021-09-27
  • 2021-12-15
猜你喜欢
  • 2021-09-27
  • 2021-12-05
  • 2021-09-27
  • 2021-12-15
  • 2021-09-27
  • 2021-09-27
  • 2021-11-06
相关资源
相似解决方案