website/ts/imgPreview.ts

7 lines
343 B
TypeScript
Raw Normal View History

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