选项
所有
  • 公共
  • 公共/受保护
  • 所有
菜单

层级

索引

方法

可选 _beforeBreakpoint

  • _beforeBreakpoint(swiper: any, breakpointParams: any): void
  • !内部:断点改变之前触发的事件

    参数

    • swiper: any
    • breakpointParams: any

    返回 void

可选 _containerClasses

  • _containerClasses(swiper: any, classNames: string): void
  • !内部:在 Swiper 容器元素上设置 CSS 类之后触发的事件

    参数

    • swiper: any
    • classNames: string

    返回 void

可选 _freeModeNoMomentumRelease

  • _freeModeNoMomentumRelease(swiper: any): void
  • !内部:在自由模式触摸结束(释放)且没有动量时触发的事件

    参数

    • swiper: any

    返回 void

可选 _slideClass

  • _slideClass(swiper: any, slideEl: HTMLElement, classNames: string): void
  • !内部:在 Swiper 滑动元素上设置 CSS 类之后触发的事件

    参数

    • swiper: any
    • slideEl: HTMLElement
    • classNames: string

    返回 void

可选 _slideClasses

  • _slideClasses(swiper: any, slides: { classNames: string; index: number; slideEl: HTMLElement }[]): void
  • !内部:在所有 Swiper 滑动元素上设置 CSS 类之后触发的事件

    参数

    • swiper: any
    • slides: { classNames: string; index: number; slideEl: HTMLElement }[]

    返回 void

可选 _swiper

  • _swiper(swiper: any): void
  • !内部:当 Swiper 实例可用时立即触发的事件(在初始化之前)

    参数

    • swiper: any

    返回 void

activeIndexChange

  • activeIndexChange(swiper: any): void
  • 当活动索引改变时触发的事件

    参数

    • swiper: any

    返回 void

afterInit

  • afterInit(swiper: any): void
  • 初始化后立即触发的事件

    参数

    • swiper: any

    返回 void

beforeDestroy

  • beforeDestroy(swiper: any): void
  • Swiper 销毁之前触发的事件

    参数

    • swiper: any

    返回 void

beforeInit

  • beforeInit(swiper: any): void
  • 初始化之前触发的事件

    参数

    • swiper: any

    返回 void

beforeLoopFix

  • beforeLoopFix(swiper: any): void
  • 在“循环修复”之前触发的事件

    参数

    • swiper: any

    返回 void

beforeResize

  • beforeResize(swiper: any): void
  • 在调整大小处理程序之前触发的事件

    参数

    • swiper: any

    返回 void

beforeSlideChangeStart

  • beforeSlideChangeStart(swiper: any): void
  • 在滑动改变过渡开始之前触发的事件

    参数

    • swiper: any

    返回 void

beforeTransitionStart

  • beforeTransitionStart(swiper: any, speed: number, internal: any): void
  • 在过渡开始之前触发的事件

    参数

    • swiper: any
    • speed: number
    • internal: any

    返回 void

breakpoint

  • breakpoint(swiper: any, breakpointParams: any): void
  • 在断点改变时触发的事件

    参数

    • swiper: any
    • breakpointParams: any

    返回 void

changeDirection

  • changeDirection(swiper: any): void
  • 在方向改变时触发的事件

    参数

    • swiper: any

    返回 void

click

  • click(swiper: any, event: MouseEvent | PointerEvent | TouchEvent): void
  • 当用户点击/轻触 Swiper 时触发的事件。接收 `pointerup` 事件作为参数。

    参数

    • swiper: any
    • event: MouseEvent | PointerEvent | TouchEvent

    返回 void

destroy

  • destroy(swiper: any): void
  • Swiper 销毁时触发的事件

    参数

    • swiper: any

    返回 void

doubleClick

  • doubleClick(swiper: any, event: MouseEvent | PointerEvent | TouchEvent): void
  • 当用户双击/双轻触 Swiper 时触发的事件

    参数

    • swiper: any
    • event: MouseEvent | PointerEvent | TouchEvent

    返回 void

doubleTap

  • doubleTap(swiper: any, event: MouseEvent | PointerEvent | TouchEvent): void
  • 当用户双击 Swiper 容器时触发的事件。接收 `pointerup` 事件作为参数

    参数

    • swiper: any
    • event: MouseEvent | PointerEvent | TouchEvent

    返回 void

fromEdge

  • fromEdge(swiper: any): void
  • 当 Swiper 从起始或结束位置离开时触发的事件

    参数

    • swiper: any

    返回 void

init

  • init(swiper: any): any
  • Swiper 初始化后立即触发。

    注意

    请注意,使用 `swiper.on('init')` 语法,它仅在您设置 `init: false` 参数的情况下才有效。

    示例
    const swiper = new Swiper('.swiper', {
      init: false,
      // other parameters
    });
    swiper.on('init', function() {
     // do something
    });
    // init Swiper
    swiper.init();
    
    示例
    // Otherwise use it as the parameter:
    const swiper = new Swiper('.swiper', {
      // other parameters
      on: {
        init: function () {
          // do something
        },
      }
    });
    

    参数

    • swiper: any

    返回 any

lock

  • lock(swiper: any): void
  • 当 Swiper 被锁定(当 `watchOverflow` 启用时)时触发的事件

    参数

    • swiper: any

    返回 void

loopFix

  • loopFix(swiper: any): void
  • “循环修复”后触发的事件

    参数

    • swiper: any

    返回 void

momentumBounce

  • momentumBounce(swiper: any): void
  • 在动量反弹时触发的事件

    参数

    • swiper: any

    返回 void

observerUpdate

  • observerUpdate(swiper: any): void
  • 如果启用观察者并检测到 DOM 突变时触发的事件

    参数

    • swiper: any

    返回 void

orientationchange

  • orientationchange(swiper: any): void
  • 在方向改变时(例如横向 -> 纵向)触发的事件

    参数

    • swiper: any

    返回 void

progress

  • progress(swiper: any, progress: number): void
  • 当 Swiper 进度改变时触发的事件,接收始终在 0 到 1 之间的进度作为参数

    参数

    • swiper: any
    • progress: number

    返回 void

reachBeginning

  • reachBeginning(swiper: any): void
  • 当 Swiper 到达其起始位置(初始位置)时触发的事件

    参数

    • swiper: any

    返回 void

reachEnd

  • reachEnd(swiper: any): void
  • 当 Swiper 到达最后一个滑动元素时触发的事件

    参数

    • swiper: any

    返回 void

realIndexChange

  • realIndexChange(swiper: any): void
  • 在真实索引改变时触发的事件

    参数

    • swiper: any

    返回 void

resize

  • resize(swiper: any): void
  • 在窗口调整大小之前,Swiper 的 onresize 操作触发的事件

    参数

    • swiper: any

    返回 void

setTransition

  • setTransition(swiper: any, transition: number): void
  • 每次 Swiper 开始动画时触发的事件。接收当前过渡持续时间(毫秒)作为参数

    参数

    • swiper: any
    • transition: number

    返回 void

setTranslate

  • setTranslate(swiper: any, translate: number): void
  • 当 Swiper 的包装器改变其位置时触发的事件。接收当前平移值作为参数

    参数

    • swiper: any
    • translate: number

    返回 void

slideChange

  • slideChange(swiper: any): void
  • 当当前活动滑动元素改变时触发的事件

    参数

    • swiper: any

    返回 void

slideChangeTransitionEnd

  • slideChangeTransitionEnd(swiper: any): void
  • 动画到其他滑动元素(下一个或上一个)结束后触发的事件。

    参数

    • swiper: any

    返回 void

slideChangeTransitionStart

  • slideChangeTransitionStart(swiper: any): void
  • 动画到其他滑动元素(下一个或上一个)开始时触发的事件。

    参数

    • swiper: any

    返回 void

slideNextTransitionEnd

  • slideNextTransitionEnd(swiper: any): void
  • 与 "slideChangeTransitionEnd" 相同,但仅适用于“向前”方向

    参数

    • swiper: any

    返回 void

slideNextTransitionStart

  • slideNextTransitionStart(swiper: any): void
  • 与 "slideChangeTransitionStart" 相同,但仅适用于“向前”方向

    参数

    • swiper: any

    返回 void

slidePrevTransitionEnd

  • slidePrevTransitionEnd(swiper: any): void
  • 与 "slideChangeTransitionEnd" 相同,但仅适用于“向后”方向

    参数

    • swiper: any

    返回 void

slidePrevTransitionStart

  • slidePrevTransitionStart(swiper: any): void
  • 与 "slideChangeTransitionStart" 相同,但仅适用于“向后”方向

    参数

    • swiper: any

    返回 void

slideResetTransitionEnd

  • slideResetTransitionEnd(swiper: any): void
  • 将滑动元素重置到当前位置的动画结束时触发的事件

    参数

    • swiper: any

    返回 void

slideResetTransitionStart

  • slideResetTransitionStart(swiper: any): void
  • 将滑动元素重置到当前位置的动画开始时触发的事件

    参数

    • swiper: any

    返回 void

sliderFirstMove

  • sliderFirstMove(swiper: any, event: TouchEvent): void
  • 第一次触摸/拖动移动时触发的事件

    参数

    • swiper: any
    • event: TouchEvent

    返回 void

sliderMove

  • sliderMove(swiper: any, event: MouseEvent | PointerEvent | TouchEvent): void
  • 当用户触摸并移动手指滑过 Swiper 时触发的事件。接收 `pointermove` 事件作为参数。

    参数

    • swiper: any
    • event: MouseEvent | PointerEvent | TouchEvent

    返回 void

slidesGridLengthChange

  • slidesGridLengthChange(swiper: any): void
  • 当滑动网格改变时触发的事件

    参数

    • swiper: any

    返回 void

slidesLengthChange

  • slidesLengthChange(swiper: any): void
  • 当滑动元素数量改变时触发的事件

    参数

    • swiper: any

    返回 void

slidesUpdated

  • slidesUpdated(swiper: any): void
  • 在计算和更新滑动元素及其大小之后触发的事件

    参数

    • swiper: any

    返回 void

snapGridLengthChange

  • snapGridLengthChange(swiper: any): void
  • 当吸附网格改变时触发的事件

    参数

    • swiper: any

    返回 void

snapIndexChange

  • snapIndexChange(swiper: any): void
  • 在吸附索引改变时触发的事件

    参数

    • swiper: any

    返回 void

tap

  • tap(swiper: any, event: MouseEvent | PointerEvent | TouchEvent): void
  • 当用户点击/轻触 Swiper 时触发的事件。接收 `pointerup` 事件作为参数。

    参数

    • swiper: any
    • event: MouseEvent | PointerEvent | TouchEvent

    返回 void

toEdge

  • toEdge(swiper: any): void
  • 当 Swiper 到达起始或结束位置时触发的事件

    参数

    • swiper: any

    返回 void

touchEnd

  • touchEnd(swiper: any, event: MouseEvent | PointerEvent | TouchEvent): void
  • 当用户释放 Swiper 时触发的事件。接收 `pointerup` 事件作为参数。

    参数

    • swiper: any
    • event: MouseEvent | PointerEvent | TouchEvent

    返回 void

touchMove

  • touchMove(swiper: any, event: MouseEvent | PointerEvent | TouchEvent): void
  • 当用户触摸并移动手指滑过 Swiper 时触发的事件。接收 `pointermove` 事件作为参数。

    参数

    • swiper: any
    • event: MouseEvent | PointerEvent | TouchEvent

    返回 void

touchMoveOpposite

  • touchMoveOpposite(swiper: any, event: MouseEvent | PointerEvent | TouchEvent): void
  • 当用户触摸并以与方向参数相反的方向移动手指滑过 Swiper 时触发的事件。接收 `pointermove` 事件作为参数。

    参数

    • swiper: any
    • event: MouseEvent | PointerEvent | TouchEvent

    返回 void

touchStart

  • touchStart(swiper: any, event: MouseEvent | PointerEvent | TouchEvent): void
  • 当用户触摸 Swiper 时触发的事件。接收 `pointerdown` 事件作为参数。

    参数

    • swiper: any
    • event: MouseEvent | PointerEvent | TouchEvent

    返回 void

transitionEnd

  • transitionEnd(swiper: any): void
  • 过渡结束后触发的事件。

    参数

    • swiper: any

    返回 void

transitionStart

  • transitionStart(swiper: any): void
  • 过渡开始时触发的事件。

    参数

    • swiper: any

    返回 void

unlock

  • unlock(swiper: any): void
  • 当 Swiper 解锁(当 `watchOverflow` 启用时)时触发的事件

    参数

    • swiper: any

    返回 void

更新

  • update(swiper: any): void
  • 在调用 swiper.update() 后触发的事件

    参数

    • swiper: any

    返回 void

使用 TypeDoc 生成