iframe去滚动条仍可滑动实例
给滚动条加各种样式有很多兼容性问题,而且还达不到效果,
应用技巧把滚动条遮盖住就可以简单的达到效果,然后再调整下主页面左右距离就好。
<div class="iframe-wrap">
<iframe src="https://www.baidu.com/" frameborder="0" width="100%" height="400px" />
</div>
.iframe-wrap{
position: relative;
overflow: hidden;
width: 380px;
height: 450px;
}
iframe{
width: 100%;
border: none;
position: absolute;
right: -20px;
top: 0;
bottom: 0;
overflow-x: hidden;
overflow-y: scroll;
}