simple-slideshow
Simple slideshow library. Uses CSS3 transformations for animation. Compatible with Chrome, Firefox, Safari and IE 10+.
No dependencies, written in VanillaJS.
See the demo.
Install
npm install simple-slideshow
Include the script and stylesheet in your web page:
Usage
Create a list of images, and the title
and alt
texts will be used as captions. You can also wrap them in a link to make them clickable.
Initialize the slideshow:
const slideshow = '.slideshow' timeout: 5000 ;
The optional setting timeout
defines how many miliseconds to wait between slides.
You can get a reference to the target element by the property slsh.element
.
If used in an single-page app you can release all resources by calling slsh.destroy()
.
Styling
You should set a default size for the slideshow that matches your images. You can do this in CSS: