Site logo

Archived topic

Page jump when opening images in Lightbox

7 replies · Started by Carsten on May 18, 2021

Viewing posts 1–8 of 8

Hi there, when I use my child theme, I see these jumps of the page when opening an image on a users profile, see video screen capture. This does not occur in the GP main theme. I have deactivated all my custom CSS, but with same result.

https://imgur.com/vUJF513

Any idea, what can cause this if it is not a css issue?

Regards

Hi there,

Are you pertaining to why the page behind the lightbox gets pushed to the left when the lightbox opens?

If yes, its because of this:

<style id="fancybox-style-noscroll" type="text/css">.compensate-for-scrollbar{margin-right:17px;}</style>

The page gets a 17px margin when the lightbox is open. It's being toggled by a script added on the plugin you use for the lightbox.

The theme doesn't control this toggle. I suggest contacting the plugin developer of the lightbox plugin you use to ask how to remove this. :)

Hi thanks for your clarification of this issue, if it is related to the galley plugin, why does it not affect GP main theme or other themes?

Thanks!

Hi thanks for your clarification of this issue, if it is related to the galley plugin, why does it not affect GP main theme or other themes?

That's the weird part. I'm not exactly sure what's on your child theme that may affect it.

The quick fix is by overriding the margin being added by adding this CSS:

body {
    margin-right: 0 !important;
}

But here's something to ponder:

Perhaps you'll find this a worthy read. Here's a user asking about it. (and asking for a way to turn it off as well).
https://github.com/fancyapps/fancybox/issues/1731

Hi there, I just switched to GP main, so you can check this yourself?

Okay, then it must be a cache issue on my side, but good to know that it is not theme related. I have contacted the gallery plugin developer, from the code I can see it is added as a scrollbar margin compensation.

Thanks for your help investigating this issue!

No problem. Glad to be of any help. :)

This archived topic is closed to new replies.