1.0.0 • Published 5 years ago

accmi-slider v1.0.0

Weekly downloads
6
License
MIT License
Repository
github
Last release
5 years ago

Accmi-slider

Carousel with vanilla.js

Carousel with vanilla.js, mobile touch and desktop click.

Package Managers

npm i accmi-slider

Example

    <link rel="stylesheet" href="../accmi-slider.css">
    <div class='accmi-slider'>
      <div class='accmi-slider-wrapper'>

        <div class='accmi-slider-wrapper-item'>
          <img src='./images/1.jpg' alt="">
        </div>

        <div class='accmi-slider-wrapper-item'>
          <img src='./images/2.jpg' alt="">
        </div>

        <div class='accmi-slider-wrapper-item'>
          <img src='./images/3.jpg' alt="">
        </div>

        <div class='accmi-slider-wrapper-item'>
          <img src='./images/1.jpg' alt="">
        </div>
      </div>
    </div>
    
    <script src="../accmi-slider.js"></script>
    <script >
        new AccmiSlider({
          arrows: true,
          duration: 0.8,
          animation: 'ease',
          visibileItem: 1,
          arrowLeftClass: 'prev',
          arrowRightClass: 'next',
          offsetRight: 0,
          dots: true,
          beforeChange: (e) => {
            console.log(e);
          },
          infinity: true,
          typeChange: 'carousel'
        }, document.querySelector('accmi-slider'));
    </script>

GitHub Logo

Settings

OptionTypeDefaultDescription
arrowsbooleantrueenable arrows
durationnumber0.8transition-duration
animationstringeaseanimation-timing-function
visibileItemnumber1count visible elements
arrowLeftClassstringprev
arrowRightClassstringnext
arrowLeftContentstringprevcontent from arrow container
arrowRightContentstringnextcontent from arrow container
offsetRightnumber0padding-right in % for element
dotsbooleantrueenable dots (pagination)
beforeChangevoid()=>nullcallback before sliding
infinitybooleanfalseinfinity sliding
typeChangestringcarouseltype animation change (no stable) carouselzoomfade

Methods

MethodDescription
nextSlide
prevSlide
goToSlide(index)index = number slide

Development

npm run dev

License

Copyright (c) 2018 Vjalov Mikhail

Licensed under the MIT license.

1.0.0

5 years ago

0.0.9

5 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago