Fox calc
This commit is contained in:
@@ -20,34 +20,34 @@ function enableScroll() {
|
||||
//Gallery lightbox
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
// ===> DOM elements <=== //
|
||||
|
||||
const $imagesContainer = document.getElementById('gallery-lightbox');
|
||||
const $lightbox = document.getElementById('lightbox');
|
||||
|
||||
// ===> Event listeners and triggers <=== //
|
||||
if ($imagesContainer && $lightbox) {
|
||||
// ===> Event listeners and triggers <=== //
|
||||
|
||||
// Show lightbox
|
||||
$imagesContainer.addEventListener('click', e => {
|
||||
const imageWrapper = e.target.closest('.gallery-image');
|
||||
if (imageWrapper) {
|
||||
const image = imageWrapper.querySelector('img');
|
||||
if (image) {
|
||||
$lightbox.innerHTML = '<div class="close-lightbox"></div>' + image.outerHTML;
|
||||
$lightbox.classList.add('show');
|
||||
// Show lightbox
|
||||
$imagesContainer.addEventListener('click', e => {
|
||||
const imageWrapper = e.target.closest('.gallery-image');
|
||||
if (imageWrapper) {
|
||||
const image = imageWrapper.querySelector('img');
|
||||
if (image) {
|
||||
$lightbox.innerHTML = '<div class="close-lightbox"></div>' + image.outerHTML;
|
||||
$lightbox.classList.add('show');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Hide Lightbox
|
||||
$lightbox.addEventListener('click', (e) => {
|
||||
if (!e.target.hasAttribute('src')) {
|
||||
$lightbox.classList.remove('show');
|
||||
}
|
||||
});
|
||||
// Hide Lightbox
|
||||
$lightbox.addEventListener('click', (e) => {
|
||||
if (!e.target.hasAttribute('src')) {
|
||||
$lightbox.classList.remove('show');
|
||||
}
|
||||
});
|
||||
|
||||
// Loading...
|
||||
setTimeout(() =>
|
||||
$imagesContainer.classList.remove('loading')
|
||||
, 1500);
|
||||
|
||||
});
|
||||
// Loading...
|
||||
setTimeout(() => {
|
||||
$imagesContainer.classList.remove('loading');
|
||||
}, 1500);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user