소스 검색

loading加载修正

wgl 4 년 전
부모
커밋
5aea2a4e0c
3개의 변경된 파일19개의 추가작업 그리고 14개의 파일을 삭제
  1. 9 8
      index/business/index.html
  2. 5 3
      index/home/index.html
  3. 5 3
      index/pension/index.html

+ 9 - 8
index/business/index.html

@@ -36,22 +36,23 @@
 			<div class="index-load" id="index-load" style="display:block;position: absolute;bottom: 10px;right: 10px;"></div>
 		</div>
 		<script>
-
-            var indexSetInval;
+			var indexSetInval;
 			var indexStartNum = 1;
- 			indexSetInval = setInterval(function() {
+			indexSetInval = setInterval(function() {
 				indexStartNum++;
 				var str = '加载中' + ((indexStartNum % 2 == 0) ? '…' : '……');
 				document.getElementById('index-load').innerHTML = str;
- 			}, 1000)
+			}, 1000)
 		</script>
 
 		<div id="app"></div>
 
 		<script>
-			window.onload = function() {
-				clearInterval(indexSetInval);
-				removeLoading()
+			document.onreadystatechange = function() {
+				if (document.readyState == "complete") {
+					clearInterval(indexSetInval);
+					removeLoading()
+				}
 			}
 
 			function removeLoading() {
@@ -89,7 +90,7 @@
 				}
 			})();
 		</script>
-		
+
 		<script src="https://hm.baidu.com/hm.js?70f1b4bfc1d017e50a488b34b9dcc02c"></script>
 	</body>
 </html>

+ 5 - 3
index/home/index.html

@@ -78,9 +78,11 @@
 
 
 		<script>
-			window.onload = function() {
-				clearInterval(indexSetInval);
-				removeLoading()
+			document.onreadystatechange = function() {
+				if (document.readyState == "complete") {
+					clearInterval(indexSetInval);
+					removeLoading()
+				}
 			}
 
 			function removeLoading() {

+ 5 - 3
index/pension/index.html

@@ -48,9 +48,11 @@
 		<div id="app"></div>
 
 		<script>
-			window.onload = function() {
-				clearInterval(indexSetInval);
-				removeLoading()
+			document.onreadystatechange = function() {
+				if (document.readyState == "complete") {
+					clearInterval(indexSetInval);
+					removeLoading()
+				}
 			}
 
 			function removeLoading() {