image-slider-module

1.0.2 • Public • Published

Image Slider

The Odin Project - Exercise Image Slider

Create image sliders wherever you want inside you webpage. The slider changes every 5 seconds by default.

Live Demo.

Getting Started

You can download it from npm

npm i image-slider-module

First you need to create an array of your images url's

let arr = [];
arr.push(imageUrl0);
arr.push(imageUrl1);
arr.push(imageUrl2);

Then you create a new Imageslider object

/* Imageslider(widthSize, heightSize, urlsArray, changeInterval) */
let myImageslider = new Imageslider(100, 25, arr, 5000);

And add the Imageslider object to your webpage with the render method

/* Body can be any HTML container */
body.appendChild(myImageslider.render());

What have I learned?

  • Create a JavaScript Library.
  • Publish to npm.

Acknowledgement

This project was made posible thanks to The Odin Project.

License

MIT.

/image-slider-module/

    Package Sidebar

    Install

    npm i image-slider-module

    Weekly Downloads

    5

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    12.5 kB

    Total Files

    8

    Last publish

    Collaborators

    • andrsrzdc