感谢您的任何帮助,您可以提供!我正在尝试完成我网站的移动版本,但由于某种原因,我创建的叠加层中显示的内容在 Android 上查看时无法正确滚动。这在 iPhone 上不是问题。我已查看此链接,但我认为它不适用:Android 将视图覆盖在所有内容之上?
这是我的 jsfiddle 的链接:http: //jsfiddle.net/kevindp78/TkQJa/3/ 如果你想在 android 上看到这个,还有一个完整版本的链接:http: //jsfiddle.net/kevindp78/ TkQJa/3/嵌入式/结果/
这是完整的 HTML
<div id="webpagecontent"><ul>
<li>This is my webpage content.</li>
<li>This is my webpage content.</li>
<li>This is my webpage content.</li>
<li>This is my webpage content.</li>
<li>This is my webpage content.</li>
<li>This is my webpage content.</li>
<li>This is my webpage content.</li>
<li>This is my webpage content.</li>
<li>This is my webpage content.</li>
<li>This is my webpage content.</li>
<li>This is my webpage content.</li>
<li>This is my webpage content.</li>
</ul>
</div>
<div id="fixedoverlay">
<div id="overlaymatte"></div>
<a title="close" href="#" class="closeoverlay">Close</a>
<div id="overlaycontent"><ul>
<li>Here's all of my overlay content.</li>
<li>Here's all of my overlay content.</li>
<li>Here's all of my overlay content.</li>
<li>Here's all of my overlay content.</li>
<li>Here's all of my overlay content.</li>
<li>Here's all of my overlay content.</li>
<li>Here's all of my overlay content.</li>
<li>Here's all of my overlay content.</li>
<li>Here's all of my overlay content.</li>
<li>Here's all of my overlay content.</li>
<li>Here's all of my overlay content.</li>
<li>Here's all of my overlay content.</li>
<li>Here's all of my overlay content.</li>
</div>
和 CSS
#fixedoverlay, #overlaymatte {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color:rgba(255,0,0,0.5);
z-index: 999;
}
#overlaycontent {
position: relative;
max-width: 95%;
margin: 25px auto;
height: 50px;
overflow: auto;
background: #fff;
padding: 10px;
/* border: 20px solid #fff; */
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
z-index: 9999;
}
#fixedoverlay #loaderimg {
display: block;
margin: 50px auto;
}
#fixedoverlay .closeoverlay {
position: absolute;
display: block;
padding: 4px;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
border-radius: 15px;
border: 1px solid #666;
background: #eee;
width: 16px;
height: 16px;
left: 50%;
top: 12px;
margin-left: 0px;
z-index: 999999999;
}