一个轻量级,没有依赖的图片Slider库:PureSlider

jopen 9年前

一个轻量级,没有依赖的图片Slider库

Demo

http://djyde.github.io/PureSlider

Install

CommonJS:

$ npm install pureslider

Browser:

Import thedist/pureslider.dist.jsand link thedist/pureslider.css.

Usage

<div id="pure-slider">    <div class="ps-item">      <img src="foo.jpg" >    </div>    <div class="ps-item">      <img src="foo.jpg" >    </div>    <div class="ps-item">      <img src="foo.jpg" >    </div>    <div class="ps-item">      <img src="foo.jpg" >    </div>  </div>

import 'pureslider/src/pureslider.css' // Or any other way linking the stylesheet    import PureSlider from 'pureslider'    const slider = new PureSlider({ /** options **/ })    slider.slide() // start the slider

API

PureSlider([,options])

options:

key default
actionMode fade
duration 2000

PureSlider.slide()

项目主页:http://www.open-open.com/lib/view/home/1449063427483