title: Swiper JS - show part of next slide
body: <p>I want to show a part of the second slide into view. Around 20-30%.
  I have set slidesPerView to 2.1 (on mobile devices!) to show part of the next slide.
  However, when scrolling through the slides it does not snap to the start of the container which results in parts of slides not within the view when scrolling through the swiper.</p>
  <p>I've tried setting the height of the slide at 70% but this gives the same issue. I've also been fiddling with the slidesOffsetAfter parameter but no luck.</p>
  <ul>
  <li>Slide show snap to start of the container showing the whole image</li>
  <li>Next slide should be partially visible</li>
  </ul>
  <p>To see the current state of the project: <a href="https://js-dev1-1.webflow.io/" rel="nofollow noreferrer">live dev environment</a></p>
  <p>You can see the issue on desktop in horizontal swiper and on tablet view in the vertical swiper.</p>
  <p><strong>CSS</strong></p>
  <pre><code>&lt;!-- swiper CSS --&gt;
  &lt;link rel=&quot;stylesheet&quot; href=&quot;https://unpkg.com/swiper/swiper-bundle.min.css&quot;&gt;
  
  &lt;style&gt;
  @media screen and (max-width: 1079px){
  .swiper-section {
      justify-content: flex-start;
      margin-top: 194px;
  }
  }
  
  @media screen and (max-width: 1079px){
  .main-navigation {
    left: 45px;
    top: 45px;
  }
  }
  
  @media screen and (max-width: 1079px){
  .sub-navigation {
    right: 45px;
    top: 45px;
  }
  }
  
  @media screen and (max-width: 1079px){
  .swiper-container {
      height: 965px;
  }
  }
  
  .swiper-slide {
  padding-bottom: 45px;
  }
  
  @media screen and (max-width: 1079px) {
  .swiper-slide {
  padding-bottom: 0px;
  }
  }
  
  .swiper-slide:nth-child(even) {
   height: 75%;
   width: 45vw !important;
  }
  
  .swiper-slide:nth-child(odd) {
   height: 100%;
    width: 55vw !important;
  }
  
  @media screen and (max-width: 1079px) {
  .swiper-div {
  margin: 0px 45px 0px 45px;
  }
  }
  
  @media screen and (max-width: 1079px) {
  .swiper-slide:nth-child(even) {
       height: 100%!important;
       width: 100% !important;
  }
  }
  
  @media screen and (max-width: 1079px) {
  .swiper-slide:nth-child(odd) {
   height: 100%!important;
   width: 100% !important;
  }
  }
  
  
  .swiper-slide&gt;img {
      object-fit: cover;
      width: 100%;
      height: 100%;
  }
  
  .swiper-button-prev,
  .swiper-button-next {
    display: none;
  }
  
  .swiper-container-horizontal&gt;.swiper-pagination-progressbar {
    width: 175px;
    margin-left: 65px;
    border-radius: 50px;
    }
  
  .swiper-pagination-progressbar {
    margin-top: 733px;
    background: #bababa;
  }
  
  .swiper-pagination-progressbar .swiper-pagination-progressbar-fill {
  background: #888888;
  }
  
  .swiper-container-horizontal&gt;.swiper-pagination-progressbar {
  height: 12px;
  }
  
  .swiper-container-vertical&gt;.swiper-pagination-progressbar {
  display: none;
  }
  
  &lt;/style&gt;
  </code></pre>
  <p><strong>JS</strong></p>
  <pre><code>&lt;!-- swiper JS --&gt;
  &lt;script src=&quot;https://unpkg.com/swiper/swiper-bundle.min.js&quot;&gt;&lt;/script&gt;
  
  &lt;!-- Swiper - Extra Step - add arrows and pagination html markup by code (Append) --&gt;
  &lt;script&gt;
    var swiperNodes = &quot;&quot;;
    var pagination = '&lt;div class=swiper-pagination&gt;&lt;/div&gt;';
    var next_prev_buttons = '&lt;div class=&quot;swiper-button-prev&quot;&gt;&lt;/div&gt;&lt;div class=&quot;swiper-button-next&quot;&gt;&lt;/div&gt;'; 
    var scrollbar = '&lt;div class=&quot;swiper-scrollbar&quot;&gt;&lt;/div&gt;';
    var swiperNodes = swiperNodes.concat(pagination, next_prev_buttons);
    /* loop throw all swipers on the page */
    $('.swiper-container').each(function( index ) {
      $( this ).append(swiperNodes);
    });
  &lt;/script&gt;
  &lt;!-- swiper JS Initialize --&gt;
  &lt;script&gt;
    var mySwiper = new Swiper ('.swiper-container', {
      // Optional parameters
      slidesPerView: 1,
      spaceBetween: 30,
      freeMode: false,
      loop: true,
      centeredSlides: false,
      // Enable lazy loading
      lazy: true,
       mousewheel: {
      invert: true,
      },
      keyboard: {
      enabled: true,
      onlyInViewport: false,
      },
      scrollbar: {
      el: '.swiper-scrollbar',
      draggable: true,
      },
      navigation: {
        nextEl: '.swiper-button-next',
        prevEl: '.swiper-button-prev',
      },
      pagination: {
        el: '.swiper-pagination',
        type: 'progressbar',
      },
      keyboard: {
        enabled: true,
      },
      breakpoints: {
        0: { /* when window &gt;=0px - webflow mobile landscape/portriat */
          slidesPerView: 1,
          spaceBetween: 10,
          slidesOffsetBefore: 0,
          direction: 'vertical',
        },
        767: { /* when window &gt;= 767px - webflow tablet */
          slidesPerView: 2.1,
          spaceBetween: 30,
          slidesOffsetBefore: 0,
          direction: 'vertical',
        },
        1279: { /* when window &gt;= 988px - webflow desktop */
          slidesPerView: 2,
          spaceBetween: 20,
          slidesOffsetBefore: 0,
        }
      },
      /* uncomment if you want autoplay slider
      autoplay: {
        delay: 3000,
      },
      */
      /* uncomment if you want scrollbar
       scrollbar: {
          el: '.swiper-scrollbar',
          hide: true,
        },
      */
    })
  &lt;/script&gt;
  </code></pre>