Advertisement
nate_d

carousel

Aug 24th, 2019
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Allows bootstrap carousels to display 3 items per page rather than just one
  2. $('.carousel.carousel-multi .item').each(function () {
  3.     var next = $(this).next();
  4.     if (!next.length) {
  5.         next = $(this).siblings(':first');
  6.     }
  7.     next.children(':first-child').clone().attr("aria-hidden", "true").appendTo($(this));
  8.  
  9.     if (next.next().length > 0) {
  10.         next.next().children(':first-child').clone().attr("aria-hidden", "true").appendTo($(this));
  11.     }
  12.     else {
  13.         $(this).siblings(':first').children(':first-child').clone().appendTo($(this));
  14.     }
  15. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement