@silv21/image_slider

1.0.8 • Public • Published

An Image Slider

Create an image slider using the slideShow function with five parameters

Usage:

import slideShow from "https://unpkg.com/@silv21/image_slider@1.0.8/index.js";

// creating an image slider with a **Click Event** (true) for the user to slide back and forth
// slider will automatically change image every 2 sec (2000 ms, arbitrary time settings) 
// an array needs to be provided
// mouse event is off (false)
// use the variable names imageElement and array for the function to work 
// in the html make sure left and right buttons get the id names #buttonLeft & #buttonLeft for the function to work
var imageElement = document.querySelector("anImageContainerId") // anImageContainerId with an empty src=""

var array = ["./img1.jpg", "./img2.jpg", "./img3.jpg", "./img4.jpg"]

slideShow(imageElement, array, 2000, false, true);
import slideShow from "https://unpkg.com/@silv21/image_slider@1.0.8/index.js";

// creating an image slider with **Mouse Event** (true) when the user hovers over the image (freezes the image)
// slider will automatically change image every 2 sec (2000 ms, arbitrary time settings) 
// an array needs to be provided
// click event is off (false)
// use the variable names imageElement, array, buttonLeft and buttonRight for the function to work 
var imageElement = document.querySelector("anImageContainerId") // anImageContainerId with an empty src=""

var array = ["./img1.jpg", "./img2.jpg", "./img3.jpg", "./img4.jpg"]

slideShow(imageElement, array, 2000, true, false);

Package Sidebar

Install

npm i @silv21/image_slider

Weekly Downloads

0

Version

1.0.8

License

MIT

Unpacked Size

3.72 kB

Total Files

3

Last publish

Collaborators

  • silv21