HTML


<div class="sample sample05">
  <div class="swiper-container">
    <div class="swiper-wrapper">
      <div class="swiper-slide"><img src="./img/img01.png"></div>
      <div class="swiper-slide"><img src="./img/img02.png"></div>
      <div class="swiper-slide"><img src="./img/img03.png"></div>
      <div class="swiper-slide"><img src="./img/img04.png"></div>
    </div>
      
    <div class="swiper-button-prev"></div>
    <div class="swiper-button-next"></div>

    <div class="swiper-pagination"></div>
  </div>
</div>

CSS


@media (min-width: 920px) {
  .sample05 .swiper-wrapper {
    flex-wrap: wrap;
    justify-content: space-between;
  }
  .sample05 .swiper-slide {
    width: 50%;
    padding: 10px;
  }
  .sample05 .swiper-button-prev,
  .sample05 .swiper-button-next,
  .sample05 .swiper-pagination {
    display: none;
  }
}

JavaScript


var scaleWindowW = function() {
  var w = (window.innerWidth || document.documentElement.clientWidth || 0);
  return w;
};

window.addEventListener('DOMContentLoaded', function() {
  var swiper05 = undefined;
  var swiperEl = document.querySelector('.sample05 .swiper-container');
  var swiperWrapper = document.getElementsByClassName('swiper-wrapper');
  var swiperSlide = document.getElementsByClassName('swiper-slide');

  var initSwiper = function() {
    if (scaleWindowW() < 920 && swiper05 == undefined) {
        swiper05 = new Swiper(swiperEl, {
        pagination: '.swiper-pagination',
        nextButton: '.swiper-button-next',
        prevButton: '.swiper-button-prev',
        loop: true,
        slidesPerView: 2,
        centeredSlides : true
      });
      
    } else if (scaleWindowW() >= 920 && swiper05 != undefined) {
      swiper05.destroy();
      swiper05 = undefined;
      for ( var i = 0; i < swiperWrapper.length; i++ ) {
        swiperWrapper[i].removeAttribute('style');
      }
      for ( var i =0; i < swiperSlide.length; i++ ) {
        swiperSlide[i].removeAttribute('style');
      }
    }
  }
  initSwiper();

  window.addEventListener('resize',initSwiper);
}, false);  

参考URL

レスポンシブ対応でjQuery不要の高機能スライダー「Swiper」 | will STYLE Inc.|神戸にあるウェブ制作会社