This commit is contained in:
Valentin Silytuin 2024-03-26 14:13:00 +04:00
parent f146d1e3f3
commit 7495ba6122
1 changed files with 8 additions and 0 deletions

View File

@ -168,6 +168,10 @@ const init = async (items = [], options = {}, index = 0) => {
const gallery = document.body.querySelector('.advdominion-lg');
gallery.querySelector('.advdominion-lg__container').style = `
visibility: hidden;
`;
await show(options?.animation?.show?.duration, options?.animation?.show?.easing);
const swiper = new Swiper(
@ -176,6 +180,10 @@ const init = async (items = [], options = {}, index = 0) => {
);
swiper.on('init', function () {
gallery.querySelector('.advdominion-lg__container').style = `
visibility: '';
`;
if (this.slides[this.activeIndex].classList.contains('advdominion-lg__item_video')) {
playVideo(this.slides[this.activeIndex]);
}