From e0b2685b1649099477a515877a8ac2aa9340c94e Mon Sep 17 00:00:00 2001 From: "Toerd@480" Date: Wed, 23 Oct 2019 23:44:18 +0200 Subject: [PATCH] Fixed resize issue for firefox -.- --- inc/js/zoom.js | 4 ++++ 1 file changed, 4 insertions(+) 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