How to make child scroll div be treated as main page?

I am building a web app at which product card expands to fullscreen. But the top bar of browser hiding on scrolldown does not react on this inner scrollable div and reacts only to main page (which is locked when the card is opened). Even the menu button which adds event listener to window and is supposed to hide on scrolldown does not do it in card. Moreover, when I decided to use custom scrollbars and packed the main page in a custom div – it stopped reacting on scroll in any situation (f.e. top bar only hides when I scrolled all the way down). How can it be fixed? Maybe a way for it to react to any scroll universally? Thank you in advance!

enter image description here

enter image description here

102 thoughts on “How to make child scroll div be treated as main page?”

Leave a Comment