K
K
Kipsy2021-06-10 21:29:54
JavaScript
Kipsy, 2021-06-10 21:29:54

How can swiper be activated at a certain resolution?

Hello. Tell me please. Is it possible somehow to initialize swiper only at a resolution greater than 900px, and if it is less to remove it and make the block normal without swiper, so that before resizing it changes back and forth and without reloading the page?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anatoly, 2021-10-19
@ant_dgt

enabled helped me ( https://swiperjs.com/swiper-api#methods-and-properties ):
const swiper = new Swiper(".main-slider", {
enabled: false,
breakpoints: {
1490: {
enabled: true ,
slidesPerView: 1,
speed: 800,
},
},
});

V
Vladimir Kudrya, 2021-06-10
@Mugenzo

I would take advantage of this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question