-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
144 lines (130 loc) · 3.07 KB
/
index.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>网页焦点图</title>
<style type="text/css">
*{margin:0 ;
padding: 0;
text-decoration: none;
}
body{padding: 20px;}
#father{
width: 1024px;
height:640px;
overflow: hidden;
position: relative;
border: 1px solid gainsboro ;
margin: 0 auto;
}
#list{
position:absolute;
z-index: 1px;
width: 5120px;
height: 640px;
}
#list img{
float: left;
width: 1024px;
height: 640px;
}
#botton {
position: absolute;
left: 450px;
bottom: 50px;
z-index: 6;
height: 10px;
width: 100px;
}
#botton span {
width: 10px;
height: 10px;
border-radius:50%;
background: #ccc;
display: inline-block;
cursor: pointer;
}
#botton .on{
background: orangered;
}
a{
text-decoration: none;
font-size: 40px;
color: #fff;
}
a{
float: left;
width: 50px;
height: 70px;
line-height: 70px;
background-color: RGBA(0, 0, 0, .3);
border-radius:4px ;
text-align:center ;
display: none;
cursor: pointer;
}
a:hover { background-color: RGBA(0, 0, 0, .7);}
#father:hover a{
display: block;
}
#left{
position: absolute;
left: 20px;
top: 300px;
}
#right{
position: absolute;
right:20px;
top:300px;
}
</style>
<script type="text/javascript">
window.onload =function() {
var list=document.getElementById('list');
var right=document.getElementById('right');
var left=document.getElementById('left');
var botton=document.getElementById('botton').getElementsByTagName('span');
var index=1;
right.onclick =function(){
index+=1;
showbotton();
list.style.left =(parseInt(list.style.left)-1024)%5120+'px';
}
left.onclick =function(){
index-=1;
showbotton();
list.style.left =(parseInt(list.style.left)+1024*-1)%5120+'px';
}
function showbotton(){
for(var i=0;i<botton.length;i++)
{
if(botton[i].className=='on')
{botton[i].className='';
break;}
}
botton[Math.abs(index -1)%5].className='on';
}
}
</script>
</head>
<body>
<div id="father">
<div id="list" style="left:0px;">
<img src="img/690f484d2f771c59ed64b92bf7222836.jpg" alt="" />
<img src="img/45830c74836462f449f1feb2861d4fad.jpg" alt="" />
<img src="img/9fd7e3737e06d0da5d8ce705f4f43924.jpg" alt="" />
<img src="img/d31a57ca2d62997474951e392907f349 (1).jpg" alt=""/>
<img src="img/7a549903f320656deb885bdc3708cc0c.jpg" alt=""/>
</div>
<div id="botton">
<span index="1" class="on"></span>
<span index="2"></span>
<span index="3"></span>
<span index="4"></span>
<span index="5"></span>
</div>
<a href="javascript:;" id="left"><</a>
<a href="javascript:;" id="right">></a>
</div>
</body>
</html>