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>
- initialise the slider with this script
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"
- Place them in the propertie
cards
// 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()