Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/thieryw/image-slider

image slider with fade animation and autoplay
https://github.com/thieryw/image-slider

Last synced: about 1 month ago
JSON representation

image slider with fade animation and autoplay

Awesome Lists containing this project

README

        

# image-slider
A verry simple and easy to use image slider.

## Features

1) fade and slide animations.

2) autoplay option.

## Usage

1) include the "slider.js" file at the bottom of your html file.

2) initialize slider object:

```javascript

let slider = new slider(document.getElementsByClassName("imageClassName"),
document.getElementById("prevArrow"), document.getElementById("nextArrow"));

```

Previous and next arrows are optional. you can have the slider runing automaticaly
with Autoplay.

3) Call the playSlider function:

```javascript

slider.playSlider(true, 3000, "slide");

```

first argument is for autoplay;

second argument is time between slides. set to null if autoplay is false;

third argument is the animation. you can choose beetween "fade" and "slide";

## html file example:

```html



slider


A verry simple image slider with autoplay



&lt


&gt


img
img
img
img
img


let slider = new Slider(document.getElementsByClassName("sliderImage"),
document.getElementById("prev"), document.getElementById("next"));


slider.playSlider(true, 3000, "slide");



```