-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanimate-swiper.html
78 lines (78 loc) · 2.63 KB
/
animate-swiper.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>SwiperJS</title>
<link href="./utils/swiper4.5.1.css" rel="stylesheet" />
<link href="./utils/animate.min.css" rel="stylesheet" />
<style>
body,
div {
margin: 0;
padding: 0;
}
div.swiper-container {
width: 100vw;
height: 100vh;
}
.swiper-wrapper .swiper-slide {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
color: #ffffff;
}
.swiper-wrapper .swiper-slide.bg1 {
background-color: #16a085;
}
.swiper-wrapper .swiper-slide.bg2 {
background-color: #2980b9;
}
</style>
</head>
<body>
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide bg1">
<img class="ani bg1" swiper-animate-effect="flip" src="./images/logo-icon.jpg" />
<h1 class="ani" swiper-animate-effect="bounceInLeft">Swiper</h1>
</div>
<div class="swiper-slide bg2">
<h1 class="ani" swiper-animate-effect="bounceInRight">Swiper 是什么?</h1>
<p class="ani" swiper-animate-effect="bounceInRight" swiper-animate-delay="0.2s">
Swiper是纯javascript打造的滑动特效插件,面向手机、平板电脑等移动终端。
</p>
<p class="ani" swiper-animate-effect="bounceInRight" swiper-animate-delay="0.4s">
Swiper能实现触屏焦点图、触屏Tab切换、触屏轮播图切换等常用效果。
</p>
<p class="ani" swiper-animate-effect="bounceInRight" swiper-animate-delay="0.6s">
Swiper开源、免费、稳定、使用简单、功能强大,是架构移动终端网站的重要选择!
</p>
</div>
</div>
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
</div>
</body>
<script src="./utils/swiper4.5.1.js"></script>
<script src="./utils/swiper.animate1.0.3.min.js"></script>
<script>
var mySwiper = new Swiper(".swiper-container", {
loop: true,
autoplay: true,
// 在swiper中初始化animate动画
on: {
init: function () {
swiperAnimateCache(this); //隐藏动画元素
swiperAnimate(this); //初始化完成开始动画
},
slideChange: function () {
swiperAnimate(this); //每个slide切换结束时也运行当前slide动画
},
},
});
</script>
</html>