iframe中的Fullpage.js无法在IOS移动版

时间:2015-12-15 14:51:01

标签: html ios css iframe fullpage.js

我正在使用Fullpage.js创建包含各个部分的整页网站。我通过全屏iframe在不同的域上使用不同的语言。

虽然我无法在IOS mobile上滚动页面。

使用以下解决方案时,页面根本不会滚动:

<iframe src="http://url.com/" style="border: 0; position:fixed; top:0; left:0; right:0; bottom:0; width:100%; height:100%">

使用这个版本时,我可以滚动一会儿,然后就会出现问题:

<style>
.demo-iframe-holder {
  position: fixed; 
  right: 0; 
  bottom: 0; 
  left: 0;
  top: 0;
  -webkit-overflow-scrolling: touch;
  overflow-y: scroll;
}

.demo-iframe-holder iframe {
  height: 100%;
  width: 100%;
}
</style>
<body>
<div class="demo-iframe-holder">
<iframe src="http://url.com/">
</div>

有没有人有解决方案? 位于iframe的网站位于:http://tinyurl.com/j9heupj

1 个答案:

答案 0 :(得分:1)

使用以下代码解决:

<style>
iframe {
    overflow: scroll !important;
    width: 100%;
    height: 100%;
    border: none;
}

div {
    height: 100%;
    width: 100%;
    position: fixed;
}
body {
    margin:0;
}
@media (max-width: 780px) {
div {
    position:absolute;
}
}
</style>
<body>
<div>
    <iframe src="http://www.website.com/">
</div>
</body>