sled
v1.5.0
Published
slide smooth like sled upon 45 degress hill
Downloads
22
Readme
Sled
Slide smooth like sled upon 45 degress hill.
modules
all modules are available in npm
$ npm i @sled/$module_name
sled contains three base modules
additional
installation
cdn
sled.js and sled.css
<link rel='stylesheet' href='https://npmcdn.com/sled/lib/sled.css'>
<script src='https://npmcdn.com/sled/lib/sled.js'></script>
<script>
let slider = new Sled($slider);
/* write here */
</script>
npm
$ npm i sled
const Sled = require('sled');
let slider = new Sled($slider);
tested with webpack
usage
<div class='sled'>
<div class='slides'>
<img class='slide' src='...'>
<img class='slide' src='...'>
<div class='slide'>
<img src='...'>
</div>
<div class='slide'>
<span> content </span>
<img src='...'>
</div>
</div>
</div>
<script>
let $slider = document.querySelector('.sled');
let slider = new Sled($slider);
</script>
slides
let slides = slider.module('slides'); // slider.modules.slides
slides.next();
slides.prev();
slides.next();
slides.next();
slides.changeTo(2); // slide to second slide
// Also you're can change slides with arrow Keys.