I am implementing a trick to stop side scrolling for Safari using what I found from this page.
Essentially, I'm putting overflow-x: hidden;
on an overall wrapper div instead of body
and head
. It effectively stops side scrolling but then it causes a div inside of that wrapper to loose it's fixed property. Specifically, I have a div that usually acts as a side sticky nav but it only activates it's fixed property at a certain scroll height.
This is the page I'm doing this for.
To recreate this effect, do the following in inspector:
- add a wrapper
div
around everything - set that div to
overflow-x: hidden;
height: 100%;
andposition: fixed
- scroll down and you'll see the sidenav isn't fixed to the page.
How do I fix this?