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

Conflict with Lightbox Links = Page Shifts Upwards #565

Open
Acrakkops opened this issue Aug 13, 2024 · 1 comment
Open

Conflict with Lightbox Links = Page Shifts Upwards #565

Acrakkops opened this issue Aug 13, 2024 · 1 comment

Comments

@Acrakkops
Copy link

Hello,

I have an issue on the Gallery page of my website developed with Webflow. Locomotive Scroll works perfectly until I open the lightbox to view an image or video. When I close it, most of the time, the page shifts upwards, with varying degrees of displacement. This results in the header being cut off and a white band appearing under the footer. I have tried recalculating the page size with locoScroll.update using different triggers, but the problem doesn’t seem to stem from there. I have also tried modifying the structure of my page in various ways, loading the entire page before displaying it, but nothing works.

I should mention that the lightbox is the default one provided by Webflow, it is not customized.

I am using Windows 11 Professional, and as a browser, Chrome Version 127.0.6533.100. However, I noticed that on Firefox, the problem does not occur, everything works perfectly. Could it be a conflict between Chrome and Locomotive Scroll?

https://chiaroscuro-quartet.webflow.io/gallery (The problem occurs randomly.)

Does anyone have any idea, whatever it may be, on how I can work around this issue?

Thank you in advance for your attention to my request!

@ronca85
Copy link

ronca85 commented Aug 17, 2024

You can "fix" this by adding:

html { height: 100%; top: 0; left: 0; position: fixed; width: 100%; }

A side effect is - you may notice a little less smooth scrolling behaviour. If you don't, problem solved.

In general the problem is Webflow and its more than a decade old bad practice where they use <a href="#"> instead of a <button> to launch a lightbox. You don't even need a lightbox - all the images are on the page already. Whenever you can, use proper elements, which is <button> in this case. Anchor elements that don't link anywhere are a no-no.

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