swiper icon indicating copy to clipboard operation
swiper copied to clipboard

Add "peek" parameter to show part of the previous and next slide

Open Mikilll94 opened this issue 3 years ago • 9 comments
trafficstars

Clear and concise description of the problem

As a developer using Swiper I want to have peek option so I can show the part of the previous and next slide.

Glide.js has this feature:

Screenshot 2021-11-28 at 12 23 47

https://glidejs.com/docs/options/

Suggested solution

Add peek parameter.

Alternative

No response

Additional context

I don't understand why such a comprehensive like Swiper.js does not have this commonly-used feature.

Validations

  • [X] Follow our Code of Conduct
  • [X] Read the docs.
  • [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

Would you like to open a PR for this feature?

  • [ ] I'm willing to open a PR

Mikilll94 avatar Nov 28 '21 11:11 Mikilll94

you can use float value with slidePerView e.g : slidePerView: 2.5

vltansky avatar Feb 05 '22 18:02 vltansky

@vltansky Thanks. This is working :) However, using this solution I cannot show the part of the previous slide. I can only show part of the next slide.

Mikilll94 avatar Feb 05 '22 22:02 Mikilll94

Try centeredSlides https://swiperjs.com/swiper-api#param-centeredSlides

vltansky avatar Feb 06 '22 06:02 vltansky

How can I disable this option? I don't want to show part of next slide, but it is showing. Slidesperview is set to 1, effect used is 'slide'.

@vltansky

kanika-awasthi avatar May 15 '23 12:05 kanika-awasthi

"I have set spaceBetween={10}, freeMode={true}, and slidesPerView={2.1} as I want 2 slides to be shown as a default. I want 10% of the third slide to be visible on both sides. However, by setting slidesPerView={2.1}, I am able to see the 10% of the slide on the right-hand side but not on the left-hand side. How can I achieve this?"

sagarvirani avatar Nov 28 '23 10:11 sagarvirani