Fixed resize issue for firefox -.-
This commit is contained in:
parent
5354aac4bf
commit
e0b2685b16
@ -14,6 +14,10 @@ function zoom(factor, imgName) {
|
|||||||
let offset = {x: img.width * factor, y: img.height * factor};
|
let offset = {x: img.width * factor, y: img.height * factor};
|
||||||
// Fix for firefox, somehow width larger than content (inline-block)
|
// Fix for firefox, somehow width larger than content (inline-block)
|
||||||
magni.style.width = img.width;
|
magni.style.width = img.width;
|
||||||
|
window.addEventListener("resize", () => {
|
||||||
|
magni.style.width = "60%";
|
||||||
|
magni.style.width = img.width;
|
||||||
|
});
|
||||||
// setup the padding (bigger zoom canvas)
|
// setup the padding (bigger zoom canvas)
|
||||||
magni.style.padding = offset.y + "px " + offset.x + "px";
|
magni.style.padding = offset.y + "px " + offset.x + "px";
|
||||||
// adjust the margin to ged rid of the extra size gained from padding
|
// adjust the margin to ged rid of the extra size gained from padding
|
||||||
|
Loading…
x
Reference in New Issue
Block a user