  $(document).ready(function () { 
    var mySwiper = new Swiper ('.swiper-container', {
      pagination: '.swiper-pagination',
      loop: true,
      autoplay: 4000,
      centeredSlides: true,
      slidesPerView: 3,
      spaceBetween: 30,
      paginationClickable: true,
      paginationBulletRender: function(index, className){
        return '<span class="swiper-navigation-bullet ' + className + '"></span>'
      },
      nextButton: '.swiper-navigation-button-next',
      prevButton: '.swiper-navigation-button-prev'
    })
    
     $('.swiper-slide').on('click', function(){
    $('.gallery').remove();
    var gallery = $('<div class="gallery"></div>');
    //var image = $(this).find('img').clone();
    var content = $(this).parentsUntil('.col-md-12').clone().addClass('gallery-slider');
    gallery.append($(content));
    $('body').append(gallery);

    var gallerySlider = new Swiper('.gallery-slider', {
      centeredSlides: true,
      slidesPerView: 1,
      loop: true
    });
  });

  $('body').on('click', '.gallery:not(> img)', function(){
    $('.gallery').remove();
  });
  });