New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

raf-slide

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

raf-slide

raf-slide

latest
Source
npmnpm
Version
1.0.12
Version published
Maintainers
1
Created
Source

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); // 屏数

Keywords

slide

FAQs

Package last updated on 10 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts