swiper,animate使用方法
1、先链接css和js文件
<link rel="stylesheet" type="text/css" href="css/swiper-3.3.1.min.css"/>
<link rel="stylesheet" type="text/css" href="css/animate.min.css"/> <script type="text/javascript" src="js/swiper-3.3.1.min.js"></script>
<script type="text/javascript" src="js/swiper.animate1.0.2.min.js"></script>
2、初始化
/* 初始化swiper.js */
var mySwiper = new Swiper('.swiper-container',{
pagination : '.swiper-pagination', //分页器
direction:'vertical', //垂直方向换页
slideToClickedSlide: true, //slide1向slide2 swipe的过程中轻点slide1会回到slide1 /* 初始化animate */
onInit: function(swiper){ //Swiper2.x的初始化是onFirstInit
swiperAnimateCache(swiper); //隐藏动画元素
setTimeout(function(){ //2s后开始运行动画(移动端总是没加载完图片就开始动画了。。。。。)
swiperAnimate(swiper); //初始化完成开始动画
},2000)
},
onSlideChangeEnd: function(swiper){
swiperAnimate(swiper); //每个slide切换结束时也运行当前slide动画
}
})
4、使用animate的动画,注意class中要加“ani”
<img class="ani pic" src="pic.jpg" swiper-animate-effect="zoomIn" swiper-animate-duration="0.7s" />
自定义的动画效果:
html中添加class=“ani” 和swiper-animate-effect=“动画名”,可以与animate自带的动画一样,在每次切换时运行动画。
<img class="ani pic" src="pic.jpg" swiper-animate-effect="shutter2" />
css中定义效果
@-webkit-keyframes shutter2{
from{top: 100%;}
to{top:;}
}
.shutter2{
-webkit-animation: shutter2 0.5s forwards;
animation: shutter2 0.5s forwards;
}
API地址: http://www.swiper.com.cn/api/start/2014/1218/140.html
swiper,animate使用方法的更多相关文章
- Swiper教程 —— 使用方法
Swiper使用方法 1.首先加载插件,需要用到的文件有swiper.min.js和swiper.min.css文件. <!DOCTYPE html> <html> <h ...
- 微信网页动画---swiper.animate.css
项目需要,自己写了个demo <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> ...
- jQuery中animate()的方法以及$("body").animate({"scrollTop":top})不被Firefox支持问题的解决
转载请注明出处:http://blog.csdn.net/dongdong9223/article/details/50846678 本文出自[我是干勾鱼的博客] jQuery中animate()的方 ...
- 使用swiper.animate时,给一个对象添加两个动画且动画循环的方法
swiper官网上给对象加一个动画的方法是 <div class="swiper-slide"> <p class="ani" swiper- ...
- swiper.animate~之~可以执行两种动画的升级版的Swiper Animate
1.下载插件swiper.animate-twice.min.js,加载进页面. <!DOCTYPE html> <html> <head> ... < ...
- Swiper.js使用方法
<!DOCTYPE html> <html> <head> ... <link rel="stylesheet" href=" ...
- js文件中模块化导入swiper.js文件方法
es6导入: 在js文件顶端 import Swiper from "../../assets/javascripts/swiper.min"; import '../../ass ...
- animate使用方法
链接:https://www.cnblogs.com/xiaohuochai/p/7372665.html
- css常用效果总结
1.给input的placeholder设置颜色 .phColor::-webkit-input-placeholder { /* WebKit, Blink, Edge */ color:maroo ...
随机推荐
- ExtJS 修改load paging时的参数
ExtJS 的pagingToolbar 在翻页的时候传入的参数是固定的 分别是start 和 limit(其中limit的值就是store.pageSize的值) 如何在每次翻页的时候传入自己的参 ...
- cocos2dx tag和zorder
当一个渲染对象加入到两外一个渲染对象中时,可以有两个可选参数,一个时tag,一个是order virtual void addChild(CCNode * child); virtual void a ...
- Windows Azure 自动伸缩已内置
WindowsAzure平台提供的主要优点之一是能够在有需要时快速缩放云中的应用程序以响应波动.去年7月以前,您必须编写自定义脚本或使用其他工具(如Wasabi或MetricsHub)来启用自动 ...
- nyoj三个水杯(bfs)
三个水杯 时间限制:1000 ms | 内存限制:65535 KB 难度:4 描述 给出三个水杯,大小不一,并且只有最大的水杯的水是装满的,其余两个为空杯子.三个水杯之间相互 ...
- http 代理 测试
Technorati 标记: http 代理验证及测试 Technorati 标记: C# 参考了网上很多资料,综合整理出来最终的代码: using System; using System.Co ...
- mysq数据库管理工具navicat基本使用方法
navicat是mysql数据库的客户端查询管理工具,本文详细的介绍了该软件的基本使用方法 本文转自 http://hejiawangjava.iteye.com/blog/2245758 sql是操 ...
- mysql安装详细步骤图解
本文转自http://blog.csdn.net/fanyunlei/article/details/21454645 别看图多,其实mysql的安装十分简单,一路next即可,只是注意倒数第三步,设 ...
- jsp 有哪些内置对象?作用分别是什么? 分别有什么方 法?
JSP共有以下9种基本内置组件 request对象 客户端请求,此请求包含来自GET/POST的请求参数,通过它才能了解到客户的需求,然后做出相应. response对象 ...
- Android应用开发基础篇(16)-----ScaleGestureDetector(缩放手势检测)
链接地址:http://www.cnblogs.com/lknlfy/archive/2012/03/11/2390274.html 一.概述 ScaleGestureDetector这个类是专门用来 ...
- JavaEE学习之类加载器
类装载子系统 在JAVA虚拟机中,负责查找并装载类型的那部分被称为类装载子系统. JAVA虚拟机有两种类装载器:启动类装载器和用户自定义类装载器.前者是JAVA虚拟机实现的一部分,后者则是Java程序 ...