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

https://github.com/betaweb/slidr

A simple JS library to handle HTML sliders
https://github.com/betaweb/slidr

carousel carousel-js carousel-slider javascript js js-library simple slider slider-animation slides slideshow slidr typescript

Last synced: about 2 months ago
JSON representation

A simple JS library to handle HTML sliders

Awesome Lists containing this project

README

          

# SlidR

A simple JS library to handle HTML sliders.

Here is a [live demo](https://codepen.io/betaweb/pen/GRgoKbN).



## Getting started
### Installation
To install SlidR, you just have to download `Slidr.min.js` in the `dist` folder and add a script into your HTML page :
```HTML

```

### Basic usage

Here a basic HTML form with a `.slider` element contains 2 slides :
```HTML


Slide #1

Slide #2


```

> The slides **MUST HAVE** a `data-slide` attribute.


And you just have to instanciate SlidR, add your slides and run it :
```JS
document.addEventListener('DOMContentLoaded', () => {
const slider = new Slidr()
slider
.add({name: 'slide1', timeout: 20 * 1000})
.add({name: 'slide2', timeout: 10 * 1000})
.run()
})
```

And.. voilà ! You have a fully functional slider ! :)


### Options & Events

Coming soon