comment 0

Swipe Support to Bootstrap’s Carousel

Adding swipe support to Bootstrap’s Carousel via jQuery mobile.

Step 01

Add Jquery mobile your webpage

<script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>

Step 02

Now that you have jquerymobile now you can use its swipe right & swipe left events.

$(document).ready(function() {
   $("#carousel-example-generic").swiperight(function() {
      $(this).carousel('prev');
    });
   $("#carousel-example-generic").swipeleft(function() {
      $(this).carousel('next');
   });
});

Step 03

There is no setup 03 check demo below.