joe223 / tiny-swiper

Ingenious JavaScript Carousel powered by wonderful plugins. Lightweight yet extensible. Import plugins as needed, No more, no less.

Home Page:https://tiny-swiper.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Auto option in slidesPerView and navigation

RodrigoTomeES opened this issue · comments

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

@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?😃

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

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

@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?

@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).

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

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

@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.

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.