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
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hey there,
I've been using Swiper slider for a long time, But still have an issue with destroy method.
This is my code:
`
function checkViewport() {
const swiper = new Swiper('.infopost-tpl-m7 .js-ipowl-m7', {
dir: 'rtl',
loop: true,
centeredSlides: true,
slidesPerView: 3,
spaceBetween: 30,
init: false,
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
breakpoints: {
400: {
spaceBetween: 15,
loop: true,
},
480: {
spaceBetween: 20,
loop: true,
},
530: {
spaceBetween: 20,
loop: true,
},
768: {
slidesPerView: 3,
spaceBetween: 20,
loop: true,
},
992: {
slidesPerView: 4,
spaceBetween: 20,
loop: false,
},
},
});
`
Works fine in desktop view, But whenever I go below 992 swiper.destroy returns:
el[domMethod] is not a functionI even switched my code to this:
`
function checkViewport() {
`
But I get:
.destroy is not a functionSo please tell me how handle destroy? Am I doing something wrong in my code?
Thanks. 🙌
All reactions