javascript - Web application not loading fully on iphone5s
问题描述
I have created a web application, That runs a preloader before displaying content on the page and the preloader is a full screen view with basic content like loading
on it.
Here is the code I'm using for the preloader
$(document).ready(function(){
setTimeout(function(){
$('.loader-main').addClass('loader-inactive');
},0)
});
My loader div looks like this
<div id="page-preloader">
<div class="loader-main">
<div class="container">
Loading content
</div>
*some image here*
</div>
</div>
and the style for the loader both active and inactive state
.loader-main{
position:fixed;
top:0px;
left:0px;
right:0px;
bottom:0px;
z-index:999;
width: 100%;
height: 100%;
background:linear-gradient(45deg,#ffd5f5,#ffffff, #ffd5f5);
will-change: opacity;
transition:all 250ms ease;
}
.loader-active{
will-change: opacity;
transition:all 350ms ease;
opacity:1!important;
}
.loader-inactive{
will-change: opacity;
transition:all 250ms ease;
opacity:0!important;
pointer-events: none!important;
}
This works perfectly on the following tested devices:
Windows, Mac, Android (chrome), iphone8, iphone6s. But while testing on iphone5s, It keeps the loading view on and never fades out, however other contents of the page can be seen since the loader has an opacity of 80%,
I've made researches but can't find any thing, Removed the preloader and it worked fine on the iphone5s, However we can't have the App without a preloader.
解决方案
推荐阅读
- c# - 派生构造函数的简写只传递给基
- python - Pygame中的旋转蒙版碰撞
- php - 如何在 PHP 中将路径枚举树表转换为数组?
- swift - 尝试使用 swift 中的随机键从字典中打印值时出现问题
- javascript - Vue.js 和 Vuex - 将访问令牌存储在商店中并将用户重定向到 URL 以进行登录
- android - Apktool - 重新打包后应用程序立即崩溃
- javascript - 如何将两个数组与一些运算符结合起来?
- angular - TypeError: this.listService.addItem(...).subscribe 不是函数
- spring-boot - Spring Boot Couchbase 请求回购突然停止
- amazon-web-services - 在 AWS Data Pipeline 中将 EmrActivity 转换为 HadoopActivity