Create Touch-enabled Bootstrap 4/3 Carousel With Swipe Carousel

Create Touch-enabled Bootstrap 4/3 Carousel With Swipe Carousel
File Size: 78.9 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT

Swipe Carousel is a jQuery plugin to create mobile-friendly Bootstrap carousels by adding smart touch support to the native Bootstrap 4 or Bootstrap 3 carousel component.

With this plugin, the users are able to navigation between carousel slides by swiping on the mobile devices.

How to use it:

1. Create a Bootstrap carousel on the page following the markup structure like this:

<link rel="stylesheet" href="" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<script src="" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
<div id="carouselExampleIndicators" class="carousel slide my-carousel" data-ride="carousel">
  <ol class="carousel-indicators">
    <li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
    <li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
    <li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
  <div class="carousel-inner">
    <div class="carousel-item active">
      <img class="d-block w-100" src="" alt="First slide">
    <div class="carousel-item">
      <img class="d-block w-100" src="" alt="Second slide">
    <div class="carousel-item">
      <img class="d-block w-100" src="" alt="Third slide">
  <a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
    <span class="carousel-control-prev-icon" aria-hidden="true"></span>
    <span class="sr-only">Previous</span>
  <a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
    <span class="carousel-control-next-icon" aria-hidden="true"></span>
    <span class="sr-only">Next</span>

2. Download and include the JavaScript file bootstrap-swipe-carousel.min.js after Bootstrap JS.

<script src="dist/bootstrap-swipe-carousel.min.js"></script>

3. Initialize the Swipe Carousel plugin and done.

  // options here

4. Set the swipe sensitivity.

  // low, medium or high
  sensitivity: 'high' 

5. You can also implement the Swipe Carousel as an ES6 module.

$ npm install swipe-carousel --save
import $ from 'jquery';
import bootstrap from 'bootstrap';
import BootstrapSwipeCarousel from 'smart-bootstrap-swipe-carousel';

This awesome jQuery plugin is developed by om/ardeshireshghi. For more Advanced Usages, please check the demo page or visit the official website.