Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1486378

    if you have set this filter:

    add_filter( 'avf_default_lightbox_no_scroll', '__return_true' );
    

    The body does not scroll away on opened lightbox

    To prevent the background from scrolling when the lightbox is open, enfold sets to the html elment an overflow: hidden.
    Enfold also considers the scroll bar, which disappears, and added a margin-right of 15px (15px–17px is a common scroll bar width).
    However, since the fixed header is virtually taken out of the DOM flow, it appears to widen. This causes the navigation to jump slightly when opening and closing the lightbox.
    Unfortunately, no additional class is added to HTML when the lightbox is open (e.g., “lightbox-active”), so I use the now-widespread pseudo-class selector “has” to compensate for this.

    html.av-default-lightbox-no-scroll body:has(.mfp-wrap) #header.av_header_sticky {
        width: calc(100% - 15px);
    }

    #1486379

    So – either you remove this setting with the margin-right: 15px again – and we live with the fact that when the lightbox is open, the background is shifted by 15px due to the disappearance of the scrollbar. Or you define another rule for this case and the fixed header.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.