我正在iOS和Android上构建一个cordova项目。
我有两个页面:index.html和home.html。在这两个页面上,我都有一个绝对定位的div(带加载),默认情况下在两个页面上都是可见的。
<body>
<div id="loading_page" class="loading_page"></div>
<section> my content </section>
</body>
和以下CSS:
body {
background-color: #fff;
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
color: #00665d;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-ms-touch-action: none;
height: 100%;
width: 100%;
overflow: hidden;
-ms-overflow-style: -ms-autohiding-scrollbar;
}
.loading_page {
background: #fff;
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 25;
}
section {
position: absolute; /* tested with relative, too */
top: 85px;
left: 75px;
right: 15px;
bottom: 0;
}
我在index.html屏幕上,当我通过JavaScript window.location.href = "home.html"
将用户重定向到另一个页面时,加载屏幕消失了第二部分,使index.html页面的后台内容可见,然后-重定向到home.html
有什么建议我可以摆脱眨眼的问题吗?只在iOS上出现
如果你想完全控制你的页面和行为,把它们作为'页面节'在一个html文件:http://demos.jquerymobile.com/1.4.1/pages/
我这样做是为了防止闪烁(在我的例子中是闪烁)。另外,你的javascript很可能有问题,检查你的控制台,以防