瀏覽代碼

启动图停顿时间

wgl 4 年之前
父節點
當前提交
08473aff71
共有 1 個文件被更改,包括 13 次插入3 次删除
  1. 13 3
      index/home/index.html

+ 13 - 3
index/home/index.html

@@ -59,8 +59,8 @@
 
 		<div id="z-loading-2" style="display: block;position:fixed;left:0px;top:0px;bottom:0px;right:0px;z-index: 999;background-color: #fff;">
 			<div style="width:100%;text-align: center;height: 100%;">
-				<img src="http://rccs.oss-cn-hangzhou.aliyuncs.com/jp_housekeeper/img/2021.jpg"
-				 style="width: 100%;height: 100%;" id="qdt" />
+				<img src="http://rccs.oss-cn-hangzhou.aliyuncs.com/jp_housekeeper/img/2021.jpg" style="width: 100%;height: 100%;"
+				 id="qdt" />
 				<div class="index-load" id="index-load" style="display:block"></div>
 			</div>
 		</div>
@@ -81,7 +81,17 @@
 			document.onreadystatechange = function() {
 				if (document.readyState == "complete") {
 					clearInterval(indexSetInval);
-					removeLoading()
+					//removeLoading()
+					var end_time = (new Date()).getTime();
+					var loading_time = end_time - start_time;
+					console.log(((loading_time) / 1000).toString() + '秒');
+					if (loading_time < 2000) {
+						setTimeout(function() {
+							removeLoading();
+						}, 2000 - (loading_time));
+					} else {
+						removeLoading()
+					}
 				}
 			}