swiper images height
This commit is contained in:
@@ -19,9 +19,12 @@ $(document).ready(function() {
|
||||
body.style.overflowY = "auto";
|
||||
}
|
||||
let swiperEl = document.querySelector('.swiper');
|
||||
if (swiperEl) {
|
||||
setSwiperHeight(swiperEl);
|
||||
swiperEl.style.opacity = 1;
|
||||
resizeVerticalImages();
|
||||
}
|
||||
initSwiper();
|
||||
swiperEl.style.opacity = 1;
|
||||
resizeVerticalImages();
|
||||
barba.init({
|
||||
transitions: [{
|
||||
name: 'opacity-transition',
|
||||
@@ -38,19 +41,25 @@ $(document).ready(function() {
|
||||
}]
|
||||
});
|
||||
barba.hooks.before((data) => {
|
||||
swiperEl.style.opacity = 0;
|
||||
if (swiperEl) {
|
||||
swiperEl.style.opacity = 0;
|
||||
}
|
||||
});
|
||||
barba.hooks.after((data) => {
|
||||
swiperEl = document.querySelector('.swiper');
|
||||
resizeVerticalImages();
|
||||
if (document.querySelector('.swiper') && !document.querySelector('.swiper-initialized')) {
|
||||
initSwiper();
|
||||
body.style.overflowY = "hidden";
|
||||
if (swiperEl) {
|
||||
setSwiperHeight(swiperEl);
|
||||
resizeVerticalImages();
|
||||
if (document.querySelector('.swiper') && !document.querySelector('.swiper-initialized')) {
|
||||
initSwiper();
|
||||
body.style.overflowY = "hidden";
|
||||
}
|
||||
swiperEl.style.opacity = 1;
|
||||
} else {
|
||||
body.style.overflowY = "auto";
|
||||
}
|
||||
swiperEl.style.opacity = 1;
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
function initSwiper() {
|
||||
@@ -72,4 +81,8 @@ function resizeVerticalImages() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setSwiperHeight(swiperEl) {
|
||||
console.log(swiperEl);
|
||||
}
|
Reference in New Issue
Block a user