Answer the question
In order to leave comments, you need to log in
Why did js stop seeing the object after building with gulp?
The problem is that after assembling all the js files, it does not see the declared slider and does not allow accessing it. Although it is declared in the same file where the function is called.
const swiper2 = new Swiper('.swiper2', {
slidesPerView: 5,
spaceBetween: 30,
freeMode: true,
});
document.querySelector('.best-titles').addEventListener('click', function (e) {
swiper2.update();
e.preventDefault();
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question