1.0.11 • Published 9 months ago

@tsr1983/simpleslideshow v1.0.11

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago

SimpleSlideshow

A very simple and lightweight image slideshow - an easy way to showcase your images on your website.

Built with pure Javascript and CSS, to avoid any dependencies.

  1. run npm install @tsr1983/simpleslideshow
  2. Add the following imports to your file: import initSlideshow from '@tsr1983/simpleslideshow' import "@tsr1983/simpleslideshow/slideshow.css"

  3. define the root element where you want the slideshow to appear: <div id='slideshowTarget'></div>

  4. Initialize the slideshow by calling initSlideshow(images, {height: 600, width: 800});
  5. The 'images' property is an array of objects, each representing an image for the slideshow, with the following properties:

    • You can set the height and width to define the dimensions of the slideshow.
    • url (required): The relative URL to the image from your project or an absolute URL to an image from an external site
    • callback (optional): A callback function, to define what will happen if the user clicks the image.

Example of use

let images = [{url:"https://picsum.photos/400/300"}, {url:"https://picsum.photos/600/600", callback: ()=> {window.open("https://www.google.com")}}, {url:"https://picsum.photos/600/1200"}];

initSlideshow(images, {height: 600, width: 800});

1.0.9

9 months ago

1.0.11

9 months ago

1.0.10

9 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago