- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchangeBackGround.html
More file actions
Latest commit
84 lines (83 loc) · 1.86 KB
/
Copy pathchangeBackGround.html
File metadata and controls
84 lines (83 loc) · 1.86 KB
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
<!DOCTYPE html>
<html>
<head>
<metacharset="utf-8">
<metahttp-equiv="X-UA-Compatible" content="IE=edge">
<title>网页换肤</title>
<linkrel="stylesheet" href="">
<style>
* {
margin:0;
padding:0;
list-style: none;
vertical-align: top;
}
body{
background:url("background/back1.jpg");
}
.c_father {
position: relative;
height:100%;
width:100%;
}
ul {
width:100%;
display: flex;
align-items: center;
justify-content: space-around;
display: none;
}
ulliimg {
margin-top:30px;
height:118px;
width:178px;
cursor: pointer;
}
.c_icons {
position: absolute;
width:50px;
height:50px;
left:45%;
cursor: pointer;
}
</style>
<script>
window.onload=function(){
varoImg=document.getElementById("i_son");
varaImgs=oImg.getElementsByTagName("img");
varoDiv=document.getElementById("i_father");
for(vari=0;i<aImgs.length;i++){
aImgs[i].index=i+1;
aImgs[i].onclick=function(){
document.body.style.background='url("background/back'+this.index+'.jpg")';
};
}
varoIcon=document.getElementById("i_icons");
varoUl=document.getElementById("i_img");
oIcon.index=0;
oIcon.onclick=function(){
if(this.index%2===0){
oUl.style.display="flex";
}else{
oUl.style.display="none";
}
this.index++;
};
};
</script>
</head>
<body>
<divid="i_father" class="c_father">
<divid="i_son" claas="c_son">
<ulid="i_img">
<li><imgsrc="background/back1.jpg" alt=""></li>
<li><imgsrc="background/back2.jpg" alt=""></li>
<li><imgsrc="background/back3.jpg" alt=""></li>
<li><imgsrc="background/back4.jpg" alt=""></li>
<li><imgsrc="background/back5.jpg" alt=""></li>
</ul>
</div>
<imgsrc="icons/down.png" alt="" id="i_icons" class="c_icons">
</div>
</body>
</html>