From f953780e8461ee24307c2ce6f0755e923f9896ec Mon Sep 17 00:00:00 2001 From: Valentin Silytuin Date: Thu, 24 Apr 2025 23:59:38 +0400 Subject: [PATCH] =?UTF-8?q?=D0=91=D0=BE=D0=BB=D0=B5=D0=B5=20=D0=BA=D0=BE?= =?UTF-8?q?=D1=80=D1=80=D0=B5=D0=BA=D1=82=D0=BD=D0=BE=D0=B5=20=D0=B2=D0=BE?= =?UTF-8?q?=D1=81=D0=BF=D1=80=D0=BE=D0=B8=D0=B7=D0=B2=D0=B5=D0=B4=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=B2=D0=B8=D0=B4=D0=B5=D0=BE=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B8=20=D0=B1=D1=8B=D1=81=D1=82=D1=80=D0=BE=D0=BC=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=BB=D0=B8=D1=81=D1=82=D1=8B=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D0=B8=20(fix)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index a4ff9c2..fc1412e 100644 --- a/index.js +++ b/index.js @@ -348,15 +348,17 @@ const init = async (items = [], options = {}, index = 0) => { }); swiper.on('slideChange', function () { - for (const [index, slide] of Object.entries(this.slides)) { - if (slide.classList.contains('advdominion-lg__item_video')) { - if (Number(index) === this.activeIndex) { - playVideo(slide); - } else { - pauseVideo(slide); + setTimeout(() => { + for (const [index, slide] of Object.entries(this.slides)) { + if (slide.classList.contains('advdominion-lg__item_video')) { + if (Number(index) === this.activeIndex) { + playVideo(slide); + } else { + pauseVideo(slide); + } } } - } + }); }); swiper.on('resize', function () {