toutes les images ne sont pas resize

This commit is contained in:
Valentin 2024-04-21 18:46:02 +02:00
parent ea8909c5d7
commit 25a022ea48
1 changed files with 6 additions and 8 deletions

View File

@ -20,9 +20,10 @@ $(document).ready(function() {
} }
let swiperEl = document.querySelector('.swiper'); let swiperEl = document.querySelector('.swiper');
if (swiperEl) { if (swiperEl) {
setSwiperHeight(swiperEl);
swiperEl.style.opacity = 1; swiperEl.style.opacity = 1;
resizeVerticalImages(); setTimeout(() => {
resizeVerticalImages();
}, 100);
} }
initSwiper(); initSwiper();
barba.init({ barba.init({
@ -48,8 +49,6 @@ $(document).ready(function() {
barba.hooks.after((data) => { barba.hooks.after((data) => {
swiperEl = document.querySelector('.swiper'); swiperEl = document.querySelector('.swiper');
if (swiperEl) { if (swiperEl) {
setSwiperHeight(swiperEl);
resizeVerticalImages();
if (document.querySelector('.swiper') && !document.querySelector('.swiper-initialized')) { if (document.querySelector('.swiper') && !document.querySelector('.swiper-initialized')) {
initSwiper(); initSwiper();
body.style.overflowY = "hidden"; body.style.overflowY = "hidden";
@ -58,6 +57,9 @@ $(document).ready(function() {
} else { } else {
body.style.overflowY = "auto"; body.style.overflowY = "auto";
} }
setTimeout(() => {
resizeVerticalImages();
}, 100);
}); });
}) })
@ -81,8 +83,4 @@ function resizeVerticalImages() {
} }
} }
} }
}
function setSwiperHeight(swiperEl) {
console.log(swiperEl);
} }