1.0.9 • Published 5 years ago

simple-carousel-js v1.0.9

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

simple-carousel

a simple carousel,without jQuery

Preview

live demo

Installation

npm install simple-carousel-js

Usage

import Carousel from 'simple-carousel-js';

const img = ['./1.jpg', './2.jpg', './3.jpg'];

const carousel = new Carousel(img, {
    // default options
    width: '100vw', // px、rem ...
    height: '50vh',
    element: '.carousel', // use document.querySelector(selector)
    duration: 1, // animation duration
    tween: 'Quart.easeOut', 
    pagination: true, // show pagination
    arrowButton: true, // show prev and next button
    momentum: 1, // turn to next page in a smaller number
    autoplay: true,
    autoplayDelay: 5,
    preventDefault: false,
    scale: false, // it's occurs when dragging
    // custom class name,string or string array
    customStyles: {
        imgClass: '',
        paginationClass: '',
        dotClass: '',
        prevButtonClass: '',
        nextButtonClass: '',
    },
});

// destroy,remove carousel html and event
carousel.destroy()

See tween

Also,you can use script tag

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago