All Projects → djyde → Pureslider

djyde / Pureslider

A lightweight, no-dependency image slider library

Programming Languages

javascript
184084 projects - #8 most used programming language

PureSlider

npm npm npm

A lightweight, no-dependency image slider library.

Demo

http://djyde.github.io/PureSlider

Install

CommonJS:

$ npm install pureslider

Browser:

Import the dist/pureslider.dist.js and link the dist/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()

Contribution

I made PureSlider because I found that there aren't many image slider libraries I can use without jQuery. Note there is only one action mode right now, so pull requests are very welcome. Let's make PureSlider a good choice for staying independent from jQuery.

Used by

License

MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].