The Bootstrap Carousel (Carousel) plug-in is a flexible, responsive way to add sliders to a site. In addition, the content is flexible enough to be an image, inline frame, video, or whatever type of content you want to place.
Because recently developed projects involve HTML5 development on mobile devices, which requires the implementation of a carousel effect. Then the quickest way, you know (Bootstrap), and then the native Bootstrap of the Carousel.js plugin does not support gestures.
And then...... Find a way to do it yourself, and then, there are the following 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 ({
swipeleft:function () {$ (this). Carousel (' Next ');
swiperight:function ( ) {$ (this). Carousel (' prev ');
Hammer.js (http://eightmedia.github.io/hammer.js/) +
Jquery.hammer.js (Https://github.com/EightMedia/jquery.hammer.js)
$ (' #carousel-generic '). Hammer (). On (' Swipeleft ', function () {
$ (this). Carousel (' Next ');
});
$ (' #carousel-generic '). Hammer (). On (' Swiperight ', function () {
$ (this). Carousel (' prev ');
It seems a bit overqualified to import the entire jQuery Mobile simply to support sliding gestures (now available in the English text)
The touchswipe on both sides of the clickable button area is not valid, and then the Hammer is selected.
The above is a small set to introduce the Bootstrap Carousel (carousel) to support the method of moving hand gestures (three), I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!