-
Notifications
You must be signed in to change notification settings - Fork 0
/
360introPage.html
98 lines (95 loc) · 1.73 KB
/
360introPage.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>360的宣传页面</title>
<script src="../js/jquery-2.1.0.min.js"></script>
</head>
<style>
body,ul,li
{
margin: 0;
padding: 0;
}
body
{
background: url("../images/bg.jpg") center;
}
.intro
{
width: 730px;
height: 390px;
margin: 100px auto 0;
border-radius: 10px;
box-shadow: 0 0 10px #fff;
background-image: url("../images/text.png");
}
ul
{
list-style: none;
width: 55px;
height: 280px;
position: fixed;
top: 200px;
right: 40px;
}
.btn ul li
{
width: 55px;
height: 55px;
border-radius: 100%;
margin-bottom: 10px;
background-image: url("../images/icon.jpg");
}
.btn ul li:hover
{
cursor: pointer;
}
</style>
<script>
$(document).ready(function(){
var index=0;
var timer=null;
$(".btn ul li").click(function(){
index = $(this).index();
move();
clearInterval(timer);
timer=setInterval(function(){
index++;
index%=4;
move()
},3000);
});
$(".intro").mouseover(function(){
clearInterval(timer);
}).mouseout(function(){
timer=setInterval(function(){
index++;
index%=4;
move()
},3000);
});
timer=setInterval(function(){
index++;
index%=4;
move()
},3000);
function move()
{
$(".btn ul li").eq(index).animate({backgroundPositionX: "-80px"},500).siblings().css("background-position-x",0);
$(".intro").animate({backgroundPositionY: -index*390 + "px"},500)
}
})
</script>
<body>
<div class="intro"></div>
<div class="btn">
<ul>
<li style="background-position-x: -80px;"></li>
<li style="background-position-y: 56px;"></li>
<li style="background-position-y: 126px;"></li>
<li style="background-position-y: 195px;"></li>
</ul>
</div>
</body>
</html>