Appendix C. Adding Swipe to the Carousel

On touch-enabled devices, the ability to swipe through a carousel offers a significant usability benefit. In this exercise, we will add swipe interaction to the Bootstrap carousel.

Considering our options

Currently, there is no foolproof way to test for touch across devices. A best practice under present circumstances is to add touch events when there is a usability gain and when we can do it without conflicting with our standard mouse events. In our case, we can easily enable swipe events on our home page carousel with a JavaScript plugin and a few lines of code.

Justin Lazanowski has posted a nice write-up of three easy options for implementing swipe interaction for the Bootstrap 3 carousel. Read his post ...

Get Bootstrap Site Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.