Widget:Carousel

From MoHA Wiki
Revision as of 00:56, October 28, 2023 by WikiVisor (talk | contribs)
 <style>
  .carousel-indicators {
     bottom: 50px;
  }
 </style>
 <script>
 $.ajaxSetup({ cache: true });
 $.when(
   mw.loader.getScript( 'https://cdnjs.cloudflare.com/ajax/libs/jquery.touchswipe/1.6.19/jquery.touchSwipe.min.js' )
 )
 .then(
 $(".carousel").swipe({
   swipe: function(event, direction, distance, duration, fingerCount, fingerData) {
     if (direction == 'left') $(this).carousel('next');
     if (direction == 'right') $(this).carousel('prev');
   },
   allowPageScroll:"vertical"
 });
 );
 </script>
 <a class="carousel-control-prev" href="#" role="button" data-slide="prev">Previous</a>
 <a class="carousel-control-next" href="#" role="button" data-slide="next">Next</a>