Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing margin on small screens #77

Open
AndiLeni opened this issue Oct 19, 2022 · 3 comments
Open

Missing margin on small screens #77

AndiLeni opened this issue Oct 19, 2022 · 3 comments

Comments

@AndiLeni
Copy link

Hello,

images are missing a margin/padding on the right side on small images.
How might this be fixed?

grafik

@AndiLeni
Copy link
Author

Here is a demo: https://jsfiddle.net/AndiLeni/jyeb2h4p/7/
As soon as the right scrollbar appears, the border is miscalculated.
There is no margin problem when no scrollbar is visible.

@AndiLeni
Copy link
Author

Any update on this @sparanoid ?

@FuzzyNat26
Copy link

Hello! I've encountered the same problem.

This issue appears to be caused by an additional scroll bar on the right side that wasn't considered in the createTransform function.

I resolved this by adjusting the viewPortWidth by subtracting the scrollBarWidth.

// on line 195
var viewportWidth =
    window.innerWidth || document.documentElement.clientWidth || 0;
var viewportHeight =
    window.innerHeight || document.documentElement.clientHeight || 0;

// Calculate scrollbar width
var scrollbarWidth =
    viewportWidth - document.documentElement.clientWidth;

// Subtract scrollbar width from viewportWidth
viewportWidth -= scrollbarWidth;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants