You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've used Swiper on a blog page in order to display 'cards' for each blog entry. Each slide uses a cell with an image, header and text underneath with a link to the blog post. The blog system uses filtering which uses Swiper again in the same layout.
The filtering works fine, however if the filter returns fewer than 4 cards (slidesPerView: 4) then the cards width is automatically defined by Swiper and they shrink so they do not fill the swiper container anymore.
Is there any workaround or simple solution to this? The only idea I can think of is jQuery to disable the Swiper when there are fewer than 4 slides.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I've used Swiper on a blog page in order to display 'cards' for each blog entry. Each slide uses a cell with an image, header and text underneath with a link to the blog post. The blog system uses filtering which uses Swiper again in the same layout.
The filtering works fine, however if the filter returns fewer than 4 cards (slidesPerView: 4) then the cards width is automatically defined by Swiper and they shrink so they do not fill the swiper container anymore.
Is there any workaround or simple solution to this? The only idea I can think of is jQuery to disable the Swiper when there are fewer than 4 slides.
Screenshots here of problem and Swiper code: https://imgur.com/a/b1r4yxo
Beta Was this translation helpful? Give feedback.
All reactions