Skip to content

Latest commit

 

History

History
68 lines (45 loc) · 1.64 KB

README.md

File metadata and controls

68 lines (45 loc) · 1.64 KB

Build Status npm npm bundle size

Bootstrap Carousel Swipe (bcSwipe)

Super lightweight jQuery plugin to enable swipe gestures for Bootstrap 3 carousels on iOS and Android.

Installation

Install the package using npm:

npm install bcswipe

This package comes with both a browser-ready, minified script, and an ES5 module.

HTML

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>

ES5

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');

Usage

Adjusting threshold will determine how long a swipe must be to move to the next carousel slide.

// Tweak settings
$('.carousel').bcSwipe({ threshold: 50 });

Development

Install developement dependencies as usual with:

npm install --dev

The browser-friendly version of the source can be generated with:

npm run build

Credits

This project was forked from bcSwipe and all credit must go to Mark Shiraldi.