|
|
|
@ -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
|
|
|
|
|