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 has been archived by the owner on Feb 23, 2023. It is now read-only.
Hi @fancyapps opening/closing causes body to jump 1px.
Body has margin right 16px but should has 17px.
You can see it on your demo. Tested on Windows, Chrome.
Looks this is because of small element width and height (50px). Make it larger (100px) and you will notice margin right for compensate-for-scrollbar class will be not 16px but 17px then.
In jquery.fancybox.js on line 538 find
$scrollDiv = $('<div style="width:50px;height:50px;overflow:scroll;" />').appendTo("body");
and replace it with
Thanks for noticing, reporting and providing useful fix! This has been included in the last release.
While it is still not perfect solution, I think it is good enough. You see, the problem is that the vertical scrollbar width of the body element is different from the other elements on the page. And sometimes this value is not round integer. In early versions the script calculated that precisely, but that causes some lag for heavy pages (e.g., pages with many dom elements) and therefore it was simplified.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi @fancyapps opening/closing causes body to jump 1px.
Body has margin right 16px but should has 17px.
You can see it on your demo. Tested on Windows, Chrome.
Looks this is because of small element width and height (50px). Make it larger (100px) and you will notice margin right for
compensate-for-scrollbar
class will be not 16px but 17px then.In jquery.fancybox.js on line 538 find
$scrollDiv = $('<div style="width:50px;height:50px;overflow:scroll;" />').appendTo("body");
and replace it with
$scrollDiv = $('<div style="width:100px;height:100px;overflow:scroll;" />').appendTo("body");
Can you please fix this?
The text was updated successfully, but these errors were encountered: