两个iframe之间tab切换,谷歌浏览器的滚动条会消失

解决方法:

1.(有滚动条的iframe)
内容放到wrapper里面

html,body{
  height:100%;
  overflow:hidden;
}
.wrapper{
   position:absolute;
   top:0;
   left:0;
   right:0;
   bottom:0;
   overflow:auto;
}

2.js控制

 $('#tabs').tabs({
                // border:false,
                onSelect: function () {
                    var iframe = $("#tabs>div:nth-child(2) iframe")
                    iframe.height("99%");
                   // console.log(iframe.height());
                    iframe.scrollWidth;
                    iframe.height("100%");
                }
                })

 

posted @ 2019-02-19 09:40  没事看看电影  阅读(650)  评论(0编辑  收藏  举报