The Bootstrap Carousel plug-in is a flexible and responsive way to add sliders to a site. Besides that, the content is flexible enough to be an image, an embedded frame, a video, or any other type of content you want to place.
Because the recent project has involved HTML5 development on mobile devices, carousel effects need to be achieved. Then the fastest way, you know (Bootstrap), then the native Bootstrap carousel.js plugin does not support gestures.
Then... think of a solution 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');});Importing the entire jQuery Mobile just to support swipe gestures seems to be a bit useless (now it has been removed from the original English text, so you can download it)
The sliding of TouchSwipe in both sides of the clickable button area is invalid, and then Hammer is selected.
The above is the BootStrap carousel plug-in (carousel) that the editor introduced to you (three ways to support left and right gesture sliding. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. Thank you very much for your support to Wulin.com website!