Super lightweight jQuery plugin to enable swipe gestures for Bootstrap 3 carousels on iOS and Android.
Install the package using npm:
npm install bcswipe
This package comes with both a browser-ready, minified script, and an ES5 module.
Include the distribution script directly into the browser.
<!-- Bootstrap is required -->
<script src="bootstrap/js/bootstrap.js"></script>
<script src="./node_modules/bcswipe/dist/jquery.bcSwipe.min.js"></script>
Import the ES5 module using the syntax appropriate for your project:
// Import plugin when 'jQuery' global is available
import 'bcswipe';
// Import plugin when 'jQuery' global is available
require('bcswipe');
Adjusting threshold will determine how long a swipe must be to move to the next carousel slide.
// Tweak settings
$('.carousel').bcSwipe({ threshold: 50 });
Install developement dependencies as usual with:
npm install --dev
The browser-friendly version of the source can be generated with:
npm run build
This project was forked from bcSwipe and all credit must go to Mark Shiraldi.