Replies: 3 comments 1 reply
-
Blank issues are not allowed. Move it to discussion then |
Beta Was this translation helpful? Give feedback.
-
So is it some magic thing that no one knows if it's even possible to achieve? :P const swiperRewardsFree = new Swiper('.swiper-container', {
slidesPerView: 'auto',
spaceBetween: 20,
// observeParents: true,
// observeSlideChildren: true,
// setWrapperSize: true,
// controller: {
// by: 'container'
// },
on: {
beforeSlideChangeStart: function(sw) {
// this.update();
// this.updateSlides();
// this.updateSize();
},
slideChange: function(sw) {
this.el.getElement('li.swiper-slide.on').removeClass('on');
this.slides[this.activeIndex].addClass('on');
// this.update();
// this.updateSlides();
// this.updateSize();
},
imagesReady: function() {
this.slides[0].addClass('on');
}
},
pagination: {
el: '.swiper-pagination',
clickable: true,
bulletElement: 'div',
},
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
}); |
Beta Was this translation helpful? Give feedback.
-
Small update. I've manage to get it to work...sort of...by making huge workaround. One of the config did almost work but last slide wasn't shown because wrong slide length. I added dummy slide at the end which surprisingly did the trick. I had to make small adjustment to the way Swiper behaves on smaller screens by setting |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi

Because I don't know if it's possible to achieve I didn't put as a new feature and I don't consider this to be a bug so...a blank issue it is. ;)I wonder if it's possible to make slider that would work as
slidesPerView: 'auto'
, which prevents Swiper to calculate same size for each slide, and at the same time take into consideration that active slide has different width then non-active one.To visualize what I mean take a look at this image:
Green is active, yellow are within visible area and grey are outside of visible area.
I tried to make this by setting
slidesPerView
to specific number and then trying to change width on events but it didn't move proper amount of pixels. So instead of spending next few hours trying to guess parameters that could work I choose to ask you. :PBeta Was this translation helpful? Give feedback.
All reactions