toutes les images ne sont pas resize 3

This commit is contained in:
Valentin 2024-04-21 18:51:08 +02:00
parent 44301d5fd4
commit 9dc1b940dc
1 changed files with 9 additions and 7 deletions

View File

@ -70,12 +70,14 @@ function initSwiper() {
} }
function resizeVerticalImages() { function resizeVerticalImages() {
let verticalImages = document.querySelectorAll('.swiper-slide > img'); setTimeout(() => {
for (let img of verticalImages) { let verticalImages = document.querySelectorAll('.swiper-slide > img');
console.log(img.clientHeight > img.clientWidth); for (let img of verticalImages) {
if (img.clientHeight > img.clientWidth) { console.log(img.clientHeight > img.clientWidth);
console.log("yes"); if (img.clientHeight > img.clientWidth) {
img.style.width = "50%"; console.log("yes");
img.style.width = "50%";
}
} }
} }, 200);
} }