swiper 轮播动画

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<meta http-equiv="X-UA-Compatible" content="ie=edge">

<title>Document</title>

<link rel="stylesheet" href="css/swiper.min.css">

<link rel="stylesheet" href="css/animate.min.css"><!--可删-->

<script src="js/jquery-1.8.3.min.js"></script>

<!-- Swiper JS -->

<script src="js/swiper.min.js"></script>

<script src="js/swiper.animate1.0.2.min.js"></script>

<style>

html, body {

position: relative;

height: 100%;

}

body {

background: #eee;

font-family: Helvetica Neue, Helvetica, Arial, sans-serif;

font-size: 14px;

color:#000;

margin: 0;

padding: 0;

}

.swiper-container {

width: 100%;

height: 100%;

}

.swiper-slide {

text-align: center;

font-size: 18px;

background: #fff;

/* Center slide text vertically */

display: -webkit-box;

display: -ms-flexbox;

display: -webkit-flex;

display: flex;

-webkit-box-pack: center;

-ms-flex-pack: center;

-webkit-justify-content: center;

justify-content: center;

-webkit-box-align: center;

-ms-flex-align: center;

-webkit-align-items: center;

align-items: center;

}

.hide{

display:none !important;

}

</style>

</head>

<body>

<div class="swiper-container ">

<div class="swiper-wrapper">

<div class="swiper-slide " >

<span class="ani" swiper-animate-effect="fadeInUp" swiper-animate-duration="0.5s" swiper-animate-delay="0.5s">Slide 1</span>

</div>

<div class="swiper-slide " >

<span class="ani" swiper-animate-effect="fadeInUp" swiper-animate-duration="0.5s" swiper-animate-delay="0.5s">Slide 2</span>

</div>

<div class="swiper-slide" >

<span class="ani" swiper-animate-effect="fadeInUp" swiper-animate-duration="0.5s" swiper-animate-delay="0.5s">Slide 3</span>

</div>

</div>

</div>

<script>

var mySwiper1 = new Swiper ('.swiper-container', {

direction: 'vertical',//竖屏

on:{

init: function(){

swiperAnimateCache(this); //隐藏动画元素

swiperAnimate(this); //初始化完成开始动画

},

slideChangeTransitionEnd: function(){

swiperAnimate(this); //每个slide切换结束时也运行当前slide动画

}

}

})

</script>

</body>

</html>

猜你喜欢

转载自blog.csdn.net/liu709127859/article/details/82682509
今日推荐