diff --git a/inc/js/zoom.js b/inc/js/zoom.js index a77ed6e..91a1cbe 100644 --- a/inc/js/zoom.js +++ b/inc/js/zoom.js @@ -14,6 +14,10 @@ function zoom(factor, imgName) { let offset = {x: img.width * factor, y: img.height * factor}; // Fix for firefox, somehow width larger than content (inline-block) magni.style.width = img.width; + window.addEventListener("resize", () => { + magni.style.width = "60%"; + magni.style.width = img.width; + }); // setup the padding (bigger zoom canvas) magni.style.padding = offset.y + "px " + offset.x + "px"; // adjust the margin to ged rid of the extra size gained from padding