14 lines
No EOL
442 B
JavaScript
14 lines
No EOL
442 B
JavaScript
import * as basicLightbox from 'basiclightbox'
|
|
|
|
let images = document.querySelectorAll("img, .clickSpan");
|
|
for(let i = 0; i < images.length; i++){
|
|
let element = images[i];
|
|
if(!(element.getAttribute("data-noPreview") === "true")) {
|
|
element.onclick = () => {
|
|
const instance = basicLightbox.create(`
|
|
<img src="${element.getAttribute("src")}">
|
|
`);
|
|
instance.show();
|
|
}
|
|
}
|
|
} |