diff --git a/user/themes/ateliers-55/js/script.js b/user/themes/ateliers-55/js/script.js index 78f2ea2..40e48a1 100644 --- a/user/themes/ateliers-55/js/script.js +++ b/user/themes/ateliers-55/js/script.js @@ -20,9 +20,10 @@ $(document).ready(function() { } let swiperEl = document.querySelector('.swiper'); if (swiperEl) { - setSwiperHeight(swiperEl); swiperEl.style.opacity = 1; - resizeVerticalImages(); + setTimeout(() => { + resizeVerticalImages(); + }, 100); } initSwiper(); barba.init({ @@ -48,8 +49,6 @@ $(document).ready(function() { barba.hooks.after((data) => { swiperEl = document.querySelector('.swiper'); if (swiperEl) { - setSwiperHeight(swiperEl); - resizeVerticalImages(); if (document.querySelector('.swiper') && !document.querySelector('.swiper-initialized')) { initSwiper(); body.style.overflowY = "hidden"; @@ -58,6 +57,9 @@ $(document).ready(function() { } else { body.style.overflowY = "auto"; } + setTimeout(() => { + resizeVerticalImages(); + }, 100); }); }) @@ -81,8 +83,4 @@ function resizeVerticalImages() { } } } -} - -function setSwiperHeight(swiperEl) { - console.log(swiperEl); } \ No newline at end of file