第一个问题, 如果“用户第一次访问我的网站”打开的是首页。下面有一个效果:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="renderer" content="webkit">
<title>WebSiteName</title>
<style type="text/css">body {
margin: 0;
padding: 0
}
.loading {
width: 100%;
height: 100%;
background: #fff;
position: absolute
}
.lodingco {
width: 200px;
height: 80px;
text-align: center;
z-index: 1;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto
}
.loading h2 {
color: #666;
margin: 0;
text-transform: uppercase;
letter-spacing: .1em;
font-size: 20px;
font-weight: 400;
font-family: cursive
}
.loading span {
display: inline-block;
vertical-align: middle;
width: .6em;
height: .6em;
margin: .19em;
background: #007DB6;
border-radius: .6em;
-webkit-animation: loading 1s infinite alternate;
animation: loading 1s infinite alternate;
animation: loading 1s infinite alternate
}
.loading span:nth-of-type(2) {
background: #008FB2;
-webkit-animation-delay: .2s;
animation-delay: .2s
}
.loading span:nth-of-type(3) {
background: #009B9E;
-webkit-animation-delay: .4s;
animation-delay: .4s
}
.loading span:nth-of-type(4) {
background: #00A77D;
-webkit-animation-delay: .6s;
animation-delay: .6s
}
.loading span:nth-of-type(5) {
background: #00B247;
-webkit-animation-delay: .8s;
animation-delay: .8s
}
.loading span:nth-of-type(6) {
background: #5AB027;
-webkit-animation-delay: 1s;
animation-delay: 1s
}
.loading span:nth-of-type(7) {
background: #A0B61E;
-webkit-animation-delay: 1.2s;;
animation-delay: 1.2s
}
@
-webkit-keyframes loading {
0% {
opactty: 0
}
100% {
opacity: 1
}
}
@
keyframes loading {
0% {
opacity: 0
}
100% {
opacity: 1;
}
}</style>
</head>
<body>
<div id="app">
<div class="loading">
<div class="lodingco"><h2>WebSiteName Loading</h2>
<span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></div>
</div>
</div>
</body>
</script>
</html>