You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 21, 2019. It is now read-only.
Some of my images load with small top/bottom or side margins. You can see this behavior in your own full screen example. Depending on the browser's window size sometimes you don’t see this issue right away. If that’s the case then try resizing the window slowly and you will see these margins appear/disappear depending on the window's size. If you stop resizing just at the right time you may see margins on all four sides. Is there a way to get rid of them? Thank you.
The text was updated successfully, but these errors were encountered:
I figured this out and I am posting it in case someone else has the same issue. It is caused by the “scaleToFit” variable being rounded to just 2 decimal points. That left room for visible margins. I changed it to 4 decimal points and the margins aren’t visible anymore.
The fix directly in e-smart-zoom-jquery.min.js:
Find line: var f=Math.min(Math.min(a.width/r.width,a.height/r.height),1).toFixed(2);
Replace with: var f=Math.min(Math.min(a.width/r.width,a.height/r.height),1).toFixed(4);
To fix in e-smart-zoom-jquery.js:
Find line: var scaleToFit = Math.min(Math.min(containerRect.width/originalSize.width, containerRect.height/originalSize.height), 1).toFixed(2); // scale to use to include the target into containerRect
Replace with: var scaleToFit = Math.min(Math.min(containerRect.width/originalSize.width, containerRect.height/originalSize.height), 1).toFixed(4); // scale to use to include the target into containerRect
Special thanks to the creator of this plugin for it being so well commented and having variable names that make since to the novices. Because of that I was able to figure out what was happening without prior knowledge of JavaScript and very little other programming skills.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Some of my images load with small top/bottom or side margins. You can see this behavior in your own full screen example. Depending on the browser's window size sometimes you don’t see this issue right away. If that’s the case then try resizing the window slowly and you will see these margins appear/disappear depending on the window's size. If you stop resizing just at the right time you may see margins on all four sides. Is there a way to get rid of them? Thank you.
The text was updated successfully, but these errors were encountered: