vendredi 4 août 2017

bootstrap multiple image carousel one image move at one time

i got result posted by Matthew Harris on codepen

Here's a link!

but when i download and use all images are moving and the one whose number is coming comes correctly

$(document).ready(function(){
  (function(){
    // setup your carousels as you normally would using JS
    // or via data attributes according to the documentation
    // http://ift.tt/20NQthv
    $('#carousel123').carousel({ interval: 2000 });
    $('#carouselABC').carousel({ interval: 3600 });
  }());

  (function(){
    $('.carousel-showsixmoveone .item').each(function(){
      var itemToClone = $(this);

      for (var i=1;i<6;i++) {
        itemToClone = itemToClone.next();

        // wrap around if at end of item collection
        if (!itemToClone.length) {
          itemToClone = $(this).siblings(':first');
        }

        // grab item, clone, add marker class, add to collection
        itemToClone.children(':first-child').clone()
          .addClass("cloneditem-"+(i))
          .appendTo($(this));
      }
    });
  }());
});

Aucun commentaire:

Enregistrer un commentaire