@lhommenul/slider

1.0.7 • Public • Published

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> 
  1. 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

  1. Creates instance of element/s.
   // Exemple :
   let element = document.createElement('li')
   element.innerText = "test"
  1. 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()

Package Sidebar

Install

npm i @lhommenul/slider

Weekly Downloads

0

Version

1.0.7

License

ISC

Unpacked Size

5.47 kB

Total Files

3

Last publish

Collaborators

  • lhommenul