Slideer
Simple wrapper to create sliders focused on animations.
This project is a fork of slider-manager
originally created by Baptiste Briel.
Installation
Prerequisites: Node.js (>=4.x, 6.x preferred) and Git.
Using yarn:
yarn add slideer
Using npm:
npm install slideer --save`
Usage
const slideWrap = documentconst slides = Array const slider = slideWrap length: slideslength loop: true { const index = eventcurrent // array index const previous = eventprevious // array index const direction = eventdirection // +1 for next, -1 for prev slideranimating = true const windowWidth = windowinnerWidth const tl = paused: true { slideranimating = false } tl tl } // remember to initialize sliderslider // if you have pagination buttonsconst prevControl = documentconst nextControl = document // automatic check for loop or limit reachedprevControlnextControl
element
el
: slider wrapper element to attach swipe event
options
loop
: true of falsedelta
: delta limiter for swipe eventscallback
: function called when user has swiped or scrolled
methods
init
: add event listenersgetCurrentIndex
: get current slide indexgoTo(index)
: goes to the slide indexdestroy
: remove event listeners
Contributors
Clone this repo:
git clone git://github.com/liqueflies/slideer.git
From project root:
npm run start
: run project onhttp://localhost:3100
with BrowserSyncnpm run bundle
: compile projectnpm run build
: uglify project
Tests
Tests will be available soon.
License
MIT, see LICENSE.md for details.