toutes les images ne sont pas resize 2
This commit is contained in:
parent
25a022ea48
commit
44301d5fd4
|
@ -21,9 +21,7 @@ $(document).ready(function() {
|
|||
let swiperEl = document.querySelector('.swiper');
|
||||
if (swiperEl) {
|
||||
swiperEl.style.opacity = 1;
|
||||
setTimeout(() => {
|
||||
resizeVerticalImages();
|
||||
}, 100);
|
||||
}
|
||||
initSwiper();
|
||||
barba.init({
|
||||
|
@ -57,11 +55,8 @@ $(document).ready(function() {
|
|||
} else {
|
||||
body.style.overflowY = "auto";
|
||||
}
|
||||
setTimeout(() => {
|
||||
resizeVerticalImages();
|
||||
}, 100);
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
function initSwiper() {
|
||||
|
@ -75,12 +70,12 @@ function initSwiper() {
|
|||
}
|
||||
|
||||
function resizeVerticalImages() {
|
||||
if (document.querySelector('.swiper')) {
|
||||
let verticalImages = document.querySelectorAll('.swiper-slide > img');
|
||||
for (let img of verticalImages) {
|
||||
console.log(img.clientHeight > img.clientWidth);
|
||||
if (img.clientHeight > img.clientWidth) {
|
||||
console.log("yes");
|
||||
img.style.width = "50%";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue