1.0.12 • Published 7 years ago

raf-slide v1.0.12

Weekly downloads
2
License
ISC
Repository
github
Last release
7 years ago

Installation

npm install raf-slide --save

Usage

var Slide = require('raf-slide');
var slide = new Slide(options);
  • options
    • el 挂载元素
    • duration 轮播动画时间(单位:毫秒)
    • auto 自动轮播,默认false
    • delay 自动轮播延迟时间(单位:毫秒)

  • methods
    • prev() 滑动到上一屏
    • next() 滑动到下一屏
    • slideTo(index) 滑动到指定屏,index从1开始

Example

<div class="swipe-component">
    <div class="swipe-items flex-row-box">
        <div class="swipe-item">第一屏</div>
        <div class="swipe-item">第二屏</div>
        <div class="swipe-item">第三屏</div>
        <div class="swipe-item">第四屏</div>
    </div>
</div>
var Slide = require('raf-slide');
var slide = new Slide({
    el: document.querySelector('.swipe-component'),
    auto: true
});

// console.log(slide.slide.index); // 当前屏索引,从1开始
// console.log(slide.slide.length); // 屏数
1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago