forked from XxSoma/XSwitch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
82 lines (82 loc) · 2.42 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<title>XSwitch</title>
<style media="screen">
/*简单reset*/
* {
margin: 0;
padding: 0;
}
/*必须,关系到单个page能否全屏显示*/
html,
body {
height: 100%;
overflow: hidden;
}
#container,
.sections,
.section {
/*必须,兼容,在浏览器不支持transform属性时,通过改变top/left完成滑动动画*/
position: relative;
/*必须,关系到单个page能否全屏显示*/
height: 100%;
}
.section {
/*有背景图时必须,关系到背景图能够全屏显示*/
background-color: #000;
background-size: cover;
background-position: 50% 50%;
}
/*非必需,只是用来设置背景图,id不会被插件用到*/
#section0 {
background-image: url(img/img1.jpg);
}
#section1 {
background-image: url(img/img2.jpg);
}
#section2 {
background-image: url(img/img3.jpg);
}
#section3 {
background-image: url(img/img4.jpg);
}
/*以下样式用来设置slider样式,可自行修改*/
.pages {
position:fixed;
right: 10px;
top: 50%;
list-style: none;
}
.pages li {
width: 8px;
height: 8px;
border-radius: 50%;
background: #fff;
margin: 15px 0 0 7px;
}
.pages li.active {
margin-left: 0;
width: 14px;
height: 14px;
border: 4px solid #FFFFFF;
background: none;
}
</style>
</head>
<body>
<!-- 插件基本结构 -->
<div id="container" data-XSwitch>
<div class="sections">
<div class="section" id="section0"></div>
<div class="section" id="section1"></div>
<div class="section" id="section2"></div>
<div class="section" id="section3"></div>
</div>
</div>
<script src="js/jquery-1.12.3.min.js" charset="utf-8"></script>
<script src="js/XSwitch.min.js" charset="utf-8"></script>
</body>
</html>