Parameter(参数) |
Type(类型) |
Default Value(默认值 |
Example(例子) |
Description(说明 |
queueStatCallbacks |
boolean |
false |
true |
设置为true时,‘slideChangeStart’回调函数入队,所以在快速滑动过程中回调函数只被调用一次。 |
queueEndCallbacks |
boolean |
false |
true |
设置为true时,‘slideChangeEnd’回调函数入队,所以在快速滑动结束后回调函数只被调用一次。 |
onFirstInit |
funciton |
- |
function(swiper) { //执行代码 } |
回调函数,首次初始化后马上执行 |
onInit |
function |
- |
function(swiper){ //执行代码 } |
回调函数,在其他所有的初始化/再初始化后马上执行 |
onSwiperCreated |
function |
- |
function(swiper){ //执行代码 } |
回调函数,当Swiper初始化完成,loop,pagination,等其他参数或方法生成之后执行 |
onTouchStart |
function |
- |
function(swiper){ //执行代码 } |
回调函数,当碰触到slider时马上执行 |
onTouchMove |
function |
- |
function(swiper){ //执行代码 } |
回调函数,当碰触slider到释放期间执行。 |
onTouchEnd |
function |
- |
function(swiper){ //执行代码 } |
回调函数,当释放slider时执行 |
onSlideReset |
function |
- |
function(swiper){ //执行代码 } |
回调函数,释放滑块之后,滑块将要滑到当前活动的slide时执行。freeMode模式下不生效。 |
onSlideChangeStart |
funciton |
- |
function(swiper){ //执行代码 } |
回调函数,当动画开始过渡到另一slide时执行,即动画开始时执行。freeMode模式下不生效。 |
onSlideChangeEnd |
function |
- |
function(swiper){ //执行代码 } |
回调函数,过渡动画结束后执行,即滑块活动停止后执行。freeMode模式下不生效。 |
onSlideNext |
function |
- |
function(swiper){ //执行代码 } |
回调函数,与onSlideChangeStart相似,但该函数只能在滑向下一slide开始时生效 |
onSlidePrev |
funciton |
- |
function(swiper){ //执行代码 } |
回调函数,与onSlideChangeStart相似,但该函数只能在滑向上一slide开始时生效 |
onSlideTouch |
function |
- |
function(swiper){ //执行代码 } |
回调函数,当触碰事件发生后生效。与onToucStart相似,不过该函数会返回.clickedSlide和.clickedSlideIndex的值 |
onImageReady |
function |
- |
function(swiper){ //执行代码 } |
回调函数,所有内置图像加载完成后执行,同时“updateOmImagesReady”需设置为“true’ |
onMomentumBounce |
function |
- |
function(swiper){ //执行代码 } |
回调函数,执行于动量反弹(momentum bounce)过程中 |
onResistanceBefore |
funciton |
- |
function(swiper,p){ //执行代码 } |
回调函数,执行于negative resistance过程中。p-返回抵抗距离。 |
onResistanceAfter |
funciton |
- |
function(swiper,p){ //执行代码 } |
回调函数,执行于positive resistance过程中。p-返回抵抗距离。 |
onSetWrapperTransition |
function |
- |
function(swiper,duration){ //执行代码 } |
回调函数,每次当Swiper开始动画时执行 |
onSetWrapperTransform |
funciton |
- |
function(swiper,transform){ //执行代码 } |
回调函数,swiper的容器wrapper改变其坐标时执行。返回带当前transform 的偏移量的对象。 |