GitPedia

PureJSCarousel

Pure JavaScript carousel plugin (touch enabled && responsive)

From vadymshymko·Updated December 7, 2023·View on GitHub·
·Archived

Demo: [https://vadymshymko.github.io/portfolio/purejscarousel/](https://vadymshymko.github.io/portfolio/purejscarousel/) The project is written primarily in JavaScript, first published in 2015. Key topics include: carousel-plugin, javascript, javascript-carousel-plugin, js, purejs.

PureJSCarousel

Pure JavaScript carousel plugin (responsive)

Demo: https://vadymshymko.github.io/portfolio/purejscarousel/

Browser support

ChromeIEFirefoxSafariOperaiOSAndroid
+9++++4+4.3+

Getting Started

1. Include PureJSCarousel files

html
<!-- stylesheet --> <link rel="stylesheet" href="path/to/purejscarousel.css"> <!-- js --> <script src="path/to/purejscarousel.js"></script>

2. Set up your HTML

html
<div class="your-selector-for-carousel"> <div class="your-selector-for-carousel-slide"> Your Content </div> <div class="your-selector-for-carousel-slide"> Your Content </div> <div class="your-selector-for-carousel-slide"> Your Content </div> <div class="your-selector-for-carousel-slide"> Your Content </div> <div class="your-selector-for-carousel-slide"> Your Content </div> <div class="your-selector-for-carousel-slide"> Your Content </div> <div class="your-selector-for-carousel-slide"> Your Content </div> ... </div>

3. Call the PureJSCarousel

html
var yourVariable = new PureJSCarousel({ carousel: '.your-selector-for-carousel', slide: '.your-selector-for-carousel-slide' });

3.1 Options

OptionTypeDefault
carouselstring (CSS selector)n/a
slidestring (CSS selector)n/a
btnNextstring (CSS selector)document.createElement('button')
btnPrevstring (CSS selector)document.createElement('button')
oneByOnebooleanfalse
speedint1000
delayint0
effectstring'linear'
autoplaybooleanfalse
autoplayDelayint1000
autoplayStartDelayintautoplayDelay
autoplayDirectionstring'next'
infinitebooleanfalse

3.2 Methods

Go to next slide: yourVariable.goToNext();

Go to prev slide: yourVariable.goToPrev();

Go to slide: yourVariable.goTo(slideIndex);

Update carousel: yourVariable.update();

Disable carousel control: yourVariable.disableControl();

Enable carousel control: yourVariable.enableControl();

Destroy: yourVariable.destroy();

Start autoplay: yourVariable.startAutoplay(autoplayDirection);

Stop autoplay: yourVariable.stopAutoplay();

Contributors

Showing top 1 contributor by commit count.

View all contributors on GitHub →

This article is auto-generated from vadymshymko/PureJSCarousel via the GitHub API.Last fetched: 6/19/2026