D
D
d3co92021-05-22 20:19:04
HTML
d3co9, 2021-05-22 20:19:04

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.
60a93c4474b25924457689.png

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

1 answer(s)
D
d3co9, 2021-05-23
@d3co9

The problem was that I had an array of sliders. It was possible to address through sliderName[0].update();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question