-
Notifications
You must be signed in to change notification settings - Fork 33
/
3dCard.html
324 lines (315 loc) · 13.1 KB
/
3dCard.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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="keywords" content="张小月,Redspite,web前端,3d轮播,图片切换效果,超炫轮播">
<meta name="description" content="抽牌效果之banner轮播 文章详情">
<meta name="author" content="张小月,Redspite">
<title>RedSpite » 抽牌效果之banner轮播 文章详情</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/syntaxy.light.min.css">
<link rel="stylesheet" href="css/base.css" type="text/css">
<link rel="stylesheet" href="css/style.css" type="text/css">
<!-- xiaoyuezhang.com Baidu tongji analytics -->
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?f87e415f9d1f6111b1d34c5f96927d9b";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
</head>
<body>
<div class="content">
<div class=" container">
<div id="top">
<img src="image/top.png" alt="回到顶部">
</div>
<div class="header-box">
<img src="image/header.jpg" alt="我的头像">
</div>
<div class="center">
<p class="myid">RedSpite</p>
</div>
<div class="my-sort center">
<a href="index.html">简历</a>
<a href="drip.html">点滴</a>
<a href="message.html">留言</a>
</div>
<div id="artical-detail">
<h4>抽牌效果之banner轮播</h4>
<p>banner轮播方式真的很多,这也算一种特别的轮播方式了吧~ </p>
<p>css3结合jq,炫的都是css3的功劳。</p>
<div id="fp-box">
<ul class="fp-img-box">
<li>
<img src="image/ban1.jpg" alt="banner1">
</li>
<li>
<img src="image/ban2.jpg" alt="banner2">
</li>
<li>
<img src="image/ban3.jpg" alt="banner3">
</li>
</ul>
<ul class="fp-num-box"></ul>
</div>
<h5>Html:</h5>
<div class="code">
<pre class="codebox">
<div class="fp-box">
<ul class="fp-img-box">
<li>
<img src="image/ban1.jpg" alt="banner1">
</li>
<li>
<img src="image/ban2.jpg" alt="banner2">
</li>
<li>
<img src="image/ban3.jpg" alt="banner3">
</li>
</ul>
<ul class="fp-num-box"></ul>
</div>
</pre>
</div>
<h5>Css:</h5>
<div class="code">
<pre class="codebox">
#fp-box,.fp-img-box li, .fp-img-box{
width:100%;
padding-bottom: 30%;
height: 0;
}
.fp-box{
position: relative;
overflow: hidden;
}
.fp-img-box{
margin-bottom: 0;
-webkit-perspective: 800px;
perspective: 800px;
-webkit-transform-style: preserve-3d;
transform-style: preserve-3d;
}
.fp-img-box li{
position: absolute;
top:0;
left: 0;
visibility: hidden;
}
.fp-img-box li img{
width: 100%;
}
.fp-num-box{
position: absolute;
bottom: 5px;
width: 100%;
text-align: center;
margin-bottom: 0;
}
.fp-num-box li{
width: 12px;
height: 12px;
background: #fff;
border: 2px solid #75aaa2;
display: inline-block;
border-radius: 50%;
margin: 0 2px;
cursor: pointer;
}
.fp-num-box li.active{
background: #75aaa2;
border: 2px solid #fff;
}
.fp-img-box li.show{
visibility: visible;
z-index: 10;
}
.fp-img-box li.show.right{
-webkit-animation: showright 1s ease;
animation: showright 1s ease;
}
.fp-img-box li.hides.right{
-webkit-animation: hideright 1s ease;
animation: hideright 1s ease;
}
.fp-img-box li.show.left{
-webkit-animation: showleft 1s ease;
animation: showleft 1s ease;
}
.fp-img-box li.hides.left{
-webkit-animation: hideleft 1s ease;
animation: hideleft 1s ease;
}
@-webkit-keyframes showright {
0%{ -webkit-transform: translateZ(-200px)}
50%{ -webkit-transform: translate(40%,0) scale(0.8) rotateY(-30deg)}
100%{ -webkit-transform: translateZ(0px)}
}
@keyframes showright {
0%{ transform: translateZ(-200px)}
50%{ transform: translate(40%,0) scale(0.8) rotateY(-30deg)}
100%{ transform: translateZ(0px)}
}
@-webkit-keyframes hideright {
0%{ -webkit-transform: translateZ(0px);visibility: visible;}
50%{ -webkit-transform: translate(-40%, 0) scale(0.8) rotateY(30deg)}
100%{ -webkit-transform: translateZ(-200px);visibility: hidden;}
}
@keyframes hideright {
0%{ transform: translateZ(0px);visibility: visible;}
50%{ transform: translate(-40% ,0) scale(0.8) rotateY(30deg)}
100%{ transform: translateZ(-200px);visibility: hidden}
}
@-webkit-keyframes showleft {
0%{ -webkit-transform: translateZ(-200px)}
50%{ -webkit-transform: translate(40%, 0) scale(0.8) rotateY(-30deg)}
100%{ -webkit-transform: translateZ(0px)}
}
@keyframes showleft {
0%{ transform: translateZ(-200px)}
50%{ transform: translate(40% ,0) scale(0.8) rotateY(-30deg)}
100%{ transform: translateZ(0px)}
}
@-webkit-keyframes hideleft {
0%{ -webkit-transform: translateZ(0px);visibility: visible;}
50%{ -webkit-transform: translate(-40%, 0) scale(0.8) rotateY(30deg)}
100%{ -webkit-transform: translateZ(-200px);visibility: hidden;}
}
@keyframes hideleft {
0%{ transform: translateZ(0px);visibility: visible;}
50%{ transform: translate(-40% ,0) scale(0.8) rotateY(30deg)}
100%{ transform: translateZ(-200px);visibility: hidden}
}
</pre>
</div>
<h5>JS:</h5>
<div class="code">
<pre class="codebox">
$(function () {
var img = $(".fp-img-box li");
var size = img.size();
//生成小圆点
var _LiHtml='';
for(var i=0;i< size;i++){
_LiHtml+=' <li> </li>';
}
$(".fp-num-box").append(_LiHtml);
//初始状态
var num = $(".fp-num-box li");
img.eq(0).addClass("show");
num.eq(0).addClass("active").siblings().removeClass("active");
var t = setInterval( move,3000);
//主函数
function move(){
var i = $(".fp-num-box li.active").index();
i++;
// console.log(i);
if(i>=size){
i=0;
}else if(i<=0){
i=size;
}
img.eq(i).attr("class","show right");
img.eq(i-1).attr("class","hides right");
num.eq(i).addClass("active").siblings().removeClass("active");
}
//圆点点击
num.click(function () {
clearInterval(t);
var index = $(".fp-num-box li.active").index();
var i = $(this).index();
//点击已激活左侧
if(index>i){
img.eq(i).attr("class","show left");
img.eq(index).attr("class","hides left");
//点击已激活右侧
}else if(index < i){
img.eq(i).attr("class","show right");
img.eq(index).attr("class","hides right");
}else{
}
num.eq(i).addClass("active").siblings().removeClass("active");
t = setInterval(move,3000);
});
});
</pre>
</div>
</div>
<p class="artical-detail-date">2016.10.11</p>
<p class="center beian">© RedSpite | <a href="http://www.miitbeian.gov.cn/publish/query/indexFirst.action">蜀ICP备16004270号</a></p>
</div>
</div>
<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/syntaxy.min.js"></script>
<script src="js/myjs.js"></script>
<script>
$(document).ready(function () {
$(".header-box").addClass("fadein");
$("#artical-detail p").append("<br/><br/>");
});
$(function () {
var img = $(".fp-img-box li");
var size = img.size();
//生成小圆点
var _LiHtml='';
for(var i=0;i<size;i++){
_LiHtml+='<li></li>';
}
$(".fp-num-box").append(_LiHtml);
//初始状态
var num = $(".fp-num-box li");
img.eq(0).addClass("show");
num.eq(0).addClass("active").siblings().removeClass("active");
var t = setInterval( move,3000);
function move(){
var i = $(".fp-num-box li.active").index();
i++;
// console.log(i);
if(i>=size){
i=0;
}else if(i<=0){
i=size;
}
img.eq(i).attr("class","show right");
img.eq(i-1).attr("class","hides right");
num.eq(i).addClass("active").siblings().removeClass("active");
}
num.click(function () {
clearInterval(t);
var index = $(".fp-num-box li.active").index();
var i = $(this).index();
if(index>i){
img.eq(i).attr("class","show left");
img.eq(index).attr("class","hides left");
}else if(index<i){
img.eq(i).attr("class","show right");
img.eq(index).attr("class","hides right");
}else{
}
num.eq(i).addClass("active").siblings().removeClass("active");
t = setInterval(move,3000);
});
});
</script>
<script>
(function(){
var bp = document.createElement('script');
var curProtocol = window.location.protocol.split(':')[0];
if (curProtocol === 'https') {
bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
}
else {
bp.src = 'http://push.zhanzhang.baidu.com/push.js';
}
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(bp, s);
})();
</script>
</body>
</html>