chiro-canto/public/gallery/scripts/gallery.js

10 lines
297 B
JavaScript

images = document.getElementsByTagName('img');
for (img of images) {
img.addEventListener('click', function() {
if (img.classList.contains("fullscreen")) {
img.classList.remove('fullscreen');
} else {
img.classList.add('fullscreen');
}
});
}