diff --git a/user/themes/ateliers-55/js/script.js b/user/themes/ateliers-55/js/script.js index 214ade6..d2660da 100644 --- a/user/themes/ateliers-55/js/script.js +++ b/user/themes/ateliers-55/js/script.js @@ -70,14 +70,12 @@ function initSwiper() { } function resizeVerticalImages() { - setTimeout(() => { - let verticalImages = document.querySelectorAll('.swiper-slide > img'); - for (let img of verticalImages) { - console.log(img.clientHeight > img.clientWidth); + let verticalImages = document.querySelectorAll('.swiper-slide > img'); + for (let img of verticalImages) { + img.addEventListener('load', () => { if (img.clientHeight > img.clientWidth) { - console.log("yes"); img.style.width = "50%"; } - } - }, 200); + }) + } } \ No newline at end of file