1.0.7 • Published 4 years ago
@lhommenul/slider v1.0.7
SLIDER JS
Slider with no themes by default and only js childs accepted.
How to start
- download the npm package :
npm install --save-dev @lhommenul/slider
- import the script in your html before the
</body>
:
<script src="/node_modules/@lhommenul/slider/slider.js"></script>
- add this html where you want the slider to be :
<ul class="list_cards_actu"> </ul> <div class="control"> </div>
4. initialise the slider with this script
```js
new Slider({
per_pages:6,
start:0,
container : document.getElementsByClassName('list_cards_actu')[0],
cards:[]
}).init()
How to add elements
- Creates instance of element/s.
// Exemple : let element = document.createElement('li') element.innerText = "test"
2. Place them in the propertie `cards`
```js
// Exemple :
new Slider({
per_pages:6,
start:0,
container : document.getElementsByClassName('list_cards_actu')[0],
// element is the instance create in the step 1.
cards:[element]
}).init()