获取iframe外的document

在iframe中点击弹出层外部分弹出层消失,但是点击iframe外部分就操作不了弹出层了,被这个问题困扰了不少时间,今天得以解决,代码如下:

说明:$(top.document,document).click()不可以实现,要按下面的方式实现。
$(top.document).click(function (e) {
     if(!$(e.target).closest("#sysSetListWrapper").length){
          $(".sysSetListOuter").hide();
     }
 });
 $(document).click(function (e) {
     if(!$(e.target).closest("#sysSetListWrapper").length){
          $(".sysSetListOuter").hide();
      }
  });
posted @ 2017-03-22 17:27  知九  阅读(1120)  评论(0)    收藏  举报