Answer the question
In order to leave comments, you need to log in
How to activate Swiper Slider on dynamically loaded HTML?
How to activate Swiper Slider on dynamically loaded HTML that is loaded via AJAX after form submission?
Answer the question
In order to leave comments, you need to log in
If I understood correctly
// Инициализируем слайдер
let swiper = new Swiper('.worksSlider', {
loop: true,
observer: true,
observeParents: true
})
// $.ajax { ....
// Получаем данные с сервера и добавляем их в слайдер
// imgPath - данные с сервера, могут быть любые
swiper.appendSlide('<div class="swiper-slide"><img src="' + imgPath + '" alt=""></div>')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question