website/ts/imgPreview.ts
2021-02-28 11:59:05 +01:00

7 lines
No EOL
343 B
TypeScript

let images:HTMLCollectionOf<HTMLImageElement> = <HTMLCollectionOf<HTMLImageElement>> document.getElementsByTagName("img");
for(let i = 0; i < images.length; i++){
let element:HTMLImageElement = images[i];
if(!(element.getAttribute("data-noPreview") === "true")) {
element.onclick = () => createDialogImage(element.src);
}
}