Search code examples
cssoverflowcss-positionparallax

Content flows over scrollbar


weird bug here. Searched on the internet for hours but no working solutions yet :(

https://www.*****.*****/

It only happens on the page with parallax, a page without parallax is fine (biografie page).

What happens is that when you look closely, you will see that the white transparant-ish header flows OVER your scrollbar.

When taking a closer look you will see that the whole body is floating over my scrollbar.

Does anyone know a way to 100% fix this? I tried lots and lots of answers on the internet but none gave me a working solution.

Hope someone can explain to me what is happening and how to solve it.

Best regards


Solution

  • You can't place the menu below the scrollbar, because the scrollbar on pages with .parallax containers is not the <body>'s scrollbar, but .parallax's scrollbar.
    And you can't place element A between element B and element B's scrollbar, unless element A is a descendant of element B.

    However, the real problem is not placing the menu under the scrollbar. The real problem is being able to use the scrollbar (click its top arrow) through the menu, where they overlap.

    Which is quite possible, using:

    .menu {
      pointer-events: none;
    }
    .menu-wrapper > * {
      pointer-events: all;
    }
    

    (This makes the menu transparent to pointer events, except for children of .menu-wrapper, which do not overlap the scrollbar).