Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto option in slidesPerView and navigation #34

Open
RodrigoTomeES opened this issue Dec 1, 2020 · 9 comments
Open

Auto option in slidesPerView and navigation #34

RodrigoTomeES opened this issue Dec 1, 2020 · 9 comments

Comments

@RodrigoTomeES
Copy link
Contributor

Hello! I would like to have "auto" option in slidesPerView and navigation feature if it is possible. Thanks!

@joe223
Copy link
Owner

joe223 commented Dec 1, 2020

@RodrigoTomeES I'd like to tackle this issue, but it's a little bit hard to catch what does 'auto' means.

Would you please give me more information or description?😃

@RodrigoTomeES
Copy link
Contributor Author

Sorry for my bad explanation, I was referring to the auto mode that Swiper.js has. https://swiperjs.com/api/

Slides grid
slidesPerView number or 'auto' 1 Number of slides per view (slides visible at the same time on slider's container).

If you use it with "auto" value and along with loop: true then you need to specify loopedSlides parameter with amount of slides to loop (duplicate)

slidesPerView: 'auto' is currently not compatible with multirow mode, when slidesPerColumn > 1

@joe223 joe223 added the discuss label Dec 2, 2020
@GiorgosK
Copy link

GiorgosK commented Dec 6, 2020

navigation arrows is something that someone would expect from a swiper/slider library, and perhaps it is somewhat a turnoff that it does not have already.

+1 for discussing implementing prev/next buttons

@joe223
Copy link
Owner

joe223 commented Dec 7, 2020

@RodrigoTomeES slidesPerView: 'auto' requires refactoring of core module. It may be implemented by next version (2.1.0😁)

The benefits of auto is that it allows user to create different size of slides, Am I right?

@joe223
Copy link
Owner

joe223 commented Dec 7, 2020

@GiorgosK It has not be implemented due to the consideration of core module size. I'm trying to keep it smaller.

Fortunately, I remove pagination module from core package since v2.0. that will help us get rid of the apprehension (although core module grows to 4kb because of complicated loop/freeMode options, but, I think this trade is pretty worth).

@GiorgosK
Copy link

GiorgosK commented Dec 7, 2020

@joe223 thanks for the answer, but still not clear. Do we expect the prev/next arrows on version 2 ? any estimate on time ?

@joe223
Copy link
Owner

joe223 commented Dec 7, 2020

v2.0 is scheduled to come out this Christmas @GiorgosK

@RodrigoTomeES
Copy link
Contributor Author

@RodrigoTomeES slidesPerView: 'auto' requires refactoring of core module. It may be implemented by next version (2.1.0😁)

The benefits of auto is that it allows user to create different size of slides, Am I right?

Mmmm I never tried to make different size of slides so I don't know. I use it so I don't have to worry about how many slides fit on each screen size.

@joe223
Copy link
Owner

joe223 commented Dec 8, 2020

https://swiperjs.com/demos/120-slides-per-view-auto.html
https://stackblitz.com/edit/swiper-demo-12-auto-slides-per-view-carousel-mode-sbasfh?file=index.html

I think auto option allow user to define different slider size or define slider size through its CSS definition from demo show blow @RodrigoTomeES , for example:

.swiper-container {
  width: 100%;
  height: 100%;
}

.swiper-slide {
  width: 80%;
}

each slider will rendered with width 80% if we set slidesPerView to auto. Otherwise, not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants