项目作者: sciactive

项目描述 :
A dependency free multiple item JavaScript carousel.
高级语言: HTML
项目地址: git://github.com/sciactive/multicarousel.git
创建时间: 2017-05-29T19:10:41Z
项目社区:https://github.com/sciactive/multicarousel

开源协议:Other

下载


MultiCarousel

A dependency free multiple item JavaScript carousel.

Installation

Install with NPM:

  1. npm install multicarousel

Demo

Check it out: https://sciactive.github.io/multicarousel/demo/

Use

Use the IIFE file in the dist directory or the ES module in the lib directory.

When you instantiate, pass an array of DOM elements as the items prop. Like this:

  1. const container = document.getElementById('MyCarousel');
  2. const carousel = new MultiCarousel({
  3. target: container,
  4. props: {
  5. items: [...container.children],
  6. // The rest of these are optional. Here are the defaults.
  7. delay: 1500, // Delay between slides.
  8. transition: 600, // Duration of slide transition.
  9. count: 5, // How many items to show at once.
  10. controls: [ // Which controls are visible.
  11. 'previous',
  12. 'next',
  13. 'pause',
  14. 'start'
  15. ]
  16. }
  17. });
  18. // Programmatic slide triggering.
  19. carousel.previous();
  20. carousel.next();
  21. // Stop and start the carousel.
  22. carousel.pause();
  23. carousel.start();

Made with Svelte

It’s made with Svelte.

Icon Credits

Icons were provided by Font Awesome and Font-Awesome-SVG-PNG.