Closed K-Jayk closed 2 weeks ago
Hmmmm, that sounds out of our (and your) control. GLightbox docs recommend (and is built around) using <a>
tags, but you could use the provided API to use buttons instead. My thought is that the browser sees the user click on a link, can't go to the href, and so instead goes to the default behavior (scroll to top in this case). Buttons don't have any scroll behavior intended in their purpose.
adding this, solved my issue.
.glightbox-open {
height: auto;
}
I've got the same issue on a site I'm developing, although it's on desktop.
I've narrowed it down to the css on my site...
html, body { height: 100% !important; }
This is for the design of the layout and can't really be changed at this stage. Remove this line, all fine. Is there a workaround? I could change the height on open & reset on close I guess.
@Cessquill What about using min-height?
html,
body {
min-height: 100% !important;
}
@gingerchew Thanks for that - I'll give it a look this week.
I ended up for now removing the global style and giving the HTML & body tags a class on all pages and removing / readding that class on open / close. Parked it for now as good enough, but I'll pick it up again shortly.
Thank you!
Describe the bug I am working on a wordpress website, built in Oxygen builder. (Using these instructions: https://oxygen4fun.supadezign.com/tutorials/how-to-add-a-lightbox-effect-to-your-images/). The lightbox works beautifully on desktop.
Unfortunately, on mobile, whenever a lightbox is opened, the page reset to the top. So the user is forced to re-scroll all the way back to where they were previously. I noticed that the scroll-reset seems to happen as/before the lightbox even loads.
I'd like for the browser to to be on the same place when the user closes the lightbox.
So far I've seen this on iPhone Pro 13, Sony Xperia II, Samsung Galaxy.
I noticed a similar problem posted from 2018, but it was marked as resolved, so I assumed that downloading the latest version of the code would work, but it doesn't seem to be the case...