Set autoHeight have a swiper on resize how?

Slider with content of different heights, on the desktop container height is explicitly set, the cell height is already auto. The breakpoints in the settings I put down, but the client wants to change heights when resize window. Tell me can I use swiper API to make this functionality. My code:
const testForm = new Swiper('.dev-form__slider', {
 simulateTouch: false,
 pagination: {
 el: '.dev-form__pagination',
 type: 'fraction',
},
 navigation: {
 nextEl: '.dev-form__btn-next',
 prevEl: '.dev-form__btn-prev',
},
 breakpoints: {
 1024: {
 touchMoveStopPropagation: false,
},
 820: {
 autoHeight: true,
},
},
});
 window.addEventListener('resize', () => {
 if (window.innerWidth < 840) {
 testForm.params.autoHeight = true;
}
 else { testForm.params.autoHeight = false; }
 });
June 3rd 19 at 20:20
0 answer

Find more questions by tags JavaScript