1.0.3 • Published 3 years ago

image_slideshow v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Image slideshow

Responsive canvas image slideshow compatible with any JS framework.

Features

  • Resizes canvas to parent div width;
  • Slide change at set interval;
  • Smooth slide change with mouse/touch input;
  • Chnage to desired slide with custom buttons.

Usage

npm install svg-path-bounds

<div>
    <canvas id='slideshow_canvas'/>
</div>
import ImageSlideshow from 'image_slideshow'

let image_slideshow = new ImageSlideshow()
image_slideshow.init(document.getElementById("slideshow_canvas"), 10/16, 10)//image slideshow canvas, height to width ratio of canvas, slide change interval in seconds

let images = []
//load images and pass them to slideshow (HTMLImageElement)
image_slideshow.setSlides(images)