Three ways to let the bootstrap Carousel plugin Carousel support left and right swipe gestures

Source: Internet
Author: User
Tags bootstrap carousel

Because recently developed projects involve HTML5 development on mobile devices, which requires a carousel effect. Then the quickest way, you know (Bootstrap), then the native Bootstrap carousel.js plugin does not support gestures.

And then...... Find your own way, and then, there are 3 solutions:

JQuery Mobile (http://jquerymobile.com/download/)

$ ("#carousel-generic"). Swipeleft (function() {  $ (this). Carousel (' Next');}); $ ( "#carousel-generic"). Swiperight (function() {  $ (this). Carousel (' prev ');}); 

TouchSwipe jQuery Plugin (https://github.com/mattbryson/TouchSwipe-Jquery-Plugin)

$ ("#carousel-generic"). Swipe ({  function() {$ (this). Carousel (' Next ');},   function() {$ (this). Carousel (' prev ');},});

Hammer.js (http://eightmedia.github.io/hammer.js/) +
Jquery.hammer.js (Https://github.com/EightMedia/jquery.hammer.js)

function () {  $ (this). Carousel (' Next "); $ (function() {  $(this ). Carousel (' prev ');});

Importing the entire jQuery Mobile just to support the swipe gesture seems a bit overqualified, (now it's out in the English language, downloadable)
The touchswipe on both sides of the button area can be clicked, and then the Hammer is selected.

English Original: http://lazcreative.com/blog/adding-swipe-support-to-bootstrap-carousel-3-0/

Original: Http://www.weste.net/2014/7-16/97866.html?utm_source=tuicool&utm_medium=referral

Three ways to let the bootstrap Carousel plugin Carousel support left and right swipe gestures

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.