【发布时间】:2015-04-09 15:19:50
【问题描述】:
我有一个网站,它有很多元素并且加载速度很慢http://www.uberdice.com。我一直在寻找一种方法来拥有一个加载页面,该页面指定正在加载的页面,因为这比一个白页更令人愉悦。
一个理想的例子是http://primedice.com。
我已经四处搜索,但建议的示例似乎都不起作用,或者我只是将它们放在错误的位置。
我创建了这个 div:
<div id="loading" style="width: 100%;
height: 100%;
background: black;
background-attachment: fixed;
background-position: top;
background-size: 100% 100%;
position: absolute;
color: white;">Loading! Please calm down guy...</div>
我将使用它作为加载页面和这个脚本来禁用它。
<script type="text/javascript">
document.getElementById("loading").style.display = "none";
</script>
但是,当我实施此操作时,它仍然给我一个白屏,并且在整个网站加载前几毫秒,我看到“正在加载” div 短暂闪烁。我不认为服务器很慢,因为 ping 正常,https://uberdice.com/test.php 加载很快。
谁能提供任何解决方案?
这是当前的 index.php 文件:
<div id="loading" style="width: 100%;
height: 100%;
background: black;
background-attachment: fixed;
background-position: top;
background-size: 100% 100%;
position: absolute;
color: white;">Loading! Please calm down guy...</div>
<?php
header('X-Frame-Options: DENY');
$init=true;
include './inc/start.php';
?>
<!DOCTYPE html>
<html>
<head>
<title><?php echo $settings['title'].' - '.$settings['description']; ?></title>
<meta name="Keywords" content=“Dogecoin, Dice, Bets, Betting”>
<meta name="Description" content=“Exclusive Dogecoin Dice Site - 50% of ALL profits go back into Dogecoin development. In association with forum CryptoBoard.org.”>
<link rel="shortcut icon" href="./favicon.ico">
<link rel="stylesheet" type="text/css" href="themes/<?php echo $settings['activeTheme']; ?>/main.css">
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="content/ext/msgbox/Scripts/jquery.msgBox.js"></script>
<link rel="stylesheet" type="text/css" href="content/ext/msgbox/Styles/msgBoxLight.css">
<script type="text/javascript" src="content/ext/qtip/jquery.qtip.min.js"></script>
<link rel="stylesheet" type="text/css" href="content/ext/qtip/jquery.qtip.min.css">
<script type="text/javascript" src="js/colors.js"></script>
<?php include './js/includer.php'; ?>
</head>
<body>
<?php include './themes/'.$settings['activeTheme'].'/frontpage.php'; ?>
<!-- _COINTOLI_IDENTIFIER_2_ -->
</body>
</html>
<?php include './inc/end.php'; ?>
<script type="text/javascript">
document.getElementById("loading").style.display = "none";
</script>
谢谢。
【问题讨论】:
-
uberdice.com 无法为我加载
-
@Duffmaster33 uberdice.com 加载但不加载 www.*。 tools.pingdom.com/fpt/#!/cep28O/http://uberdice.com
标签: javascript php jquery html events