1.0.7 • Published 4 years ago

@lhommenul/slider v1.0.7

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

SLIDER JS


Slider with no themes by default and only js childs accepted.

How to start

  1. download the npm package :
    npm install --save-dev @lhommenul/slider
  1. import the script in your html before the </body> :
    <script src="/node_modules/@lhommenul/slider/slider.js"></script>
  1. 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

  1. 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()
1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago