-
Notifications
You must be signed in to change notification settings - Fork 126
/
Copy pathfull-screen-text.html
189 lines (187 loc) · 4.21 KB
/
full-screen-text.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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1, user-scalable=0" charset="UTF-8">
<title>swipeSlide</title>
<style>
*{
margin: 0;
padding: 0;
/* 防止点击闪烁 */
-webkit-tap-highlight-color:rgba(0,0,0,0);
/* 缩放网页,文字大小不变 */
-webkit-text-size-adjust:none;
}
h1{
font-size: 16px;
}
h2{
font-size: 14px;
}
html,body{
height: 100%;
overflow: hidden;
}
.full{
overflow: hidden;
}
.full,.full ul{
position: absolute;
left: 0;
top: 0;
height: 100%;
width: 100%;
}
.full li{
position: absolute;
width: 100%;
height: 100%;
overflow: hidden;
}
.full li:nth-child(1){
background-color: red;
}
.full li:nth-child(2){
background-color: yellow;
}
.full li:nth-child(3){
background-color: blue;
}
.full li:nth-child(4){
background-color: green;
}
.full li:nth-child(5){
background-color: orange;
}
.full li h1{
position: absolute;
left: 0;
top: 50%;
width: 100%;
height: 100px;
line-height: 100px;
margin-top: -50px;
box-sizing: border-box;
text-align: center;
font-size: 20px;
-webkit-transition: -webkit-transform .7s .3s;
transition: transform .7s .3s;
}
.full li:nth-child(1) h1{
-webkit-transform: translate3d(-100%, 0, 0);
}
.full li:nth-child(2) h1{
-webkit-transform: translate3d(100%, 0, 0);
}
.full li:nth-child(3) h1{
-webkit-transform: translate3d(100%, 200%, 0);
}
.full li:nth-child(4) h1{
-webkit-transform: translate3d(-100%, 200%, 0);
}
.full li:nth-child(5) h1{
-webkit-transform: translate3d(100%, -200%, 0);
}
.full li.cur h1{
-webkit-transform: translate3d(0, 0, 0);
}
.full .arrow{
display: none;
position: absolute;
top: 50%;
width: 30px;
height: 30px;
line-height: 30px;
margin-top: -15px;
font-size: 30px;
text-align: center;
}
.full .arrow-left{
left: 15px;
-webkit-animation:arrowLeft 1s ease-out infinite;
animation:arrowLeft 1s ease-out infinite;
}
.full .arrow-right{
right: 15px;
-webkit-animation:arrowRight 1s ease-out infinite;
animation:arrowRight 1s ease-out infinite;
}
@-webkit-keyframes arrowLeft{
0%{
-webkit-transform:translate3d(0, 0, 0);
transform:translate3d(0, 0, 0);
opacity:1;
}
100%{
-webkit-transform:translate3d(-50%, 0, 0);
transform:translate3d(-50%, 0, 0);
opacity:0;
}
}
@-webkit-keyframes arrowRight{
0%{
-webkit-transform:translate3d(0, 0, 0);
transform:translate3d(0, 0, 0);
opacity:1;
}
100%{
-webkit-transform:translate3d(50%, 0, 0);
transform:translate3d(50%, 0, 0);
opacity:0;
}
}
</style>
</head>
<body>
<h1><a href="http://ons.me/" target="_blank" title="一个热爱网络的年轻人的博客">西门的后花园</a></h1>
<h2><a href="http://ons.me/500.html" target="_blank">swipeSlide for Zepto/jQuery Plugin,移动端(基于Zepto/jQuery)的轮播插件</a></h2>
<div class="full">
<ul>
<li>
<h1>第一个的标题</h1>
</li>
<li>
<h1>第二个的标题</h1>
</li>
<li>
<h1>第三个的标题</h1>
</li>
<li>
<h1>第四个的标题</h1>
</li>
<li>
<h1>第五个的标题</h1>
</li>
</ul>
<div class="arrow arrow-left">←</div>
<div class="arrow arrow-right">→</div>
</div>
<script src="js/zepto.min.js"></script>
<!-- <script src="js/jquery.min.js"></script> -->
<script src="js/swipeSlide.min.js"></script>
<script>
$(function(){
$('.full').swipeSlide({
autoSwipe:false,
firstCallback:function(i,sum){
$('.arrow-left').show();
$('.full li').first().addClass('cur');
},
callback:function(i,sum){
if(i <= 0){
$('.arrow-left').show();
}else{
$('.arrow-left').hide();
}
if(i+1 >= sum){
$('.arrow-right').show();
}else{
$('.arrow-right').hide();
}
$('.full li').eq(i).addClass('cur').siblings().removeClass('cur');
}
});
});
</script>
</body>
</html>