The website does have a fixed element with overflow:auto
. When a user positions the mouse over this element and scrolls, the element scrolls just fine. However, when the element is scrolled to the end, the page does not automatically take over the scroll. Instead, the user has to wait for about 1 second and then scroll again until the scrolling from the document takes over.
How can I make this transition smooth without the need of a scroll pause?
PS: An example of this is also the "Similar questions" box on stackoverflow.
2
Answers
When a container with overflow set to auto or scroll, only when the content within that container has reached its end will the scroll propagate to the parent or the main document. use javascript to detect the end of the content by adding an
event_listener
as:capture the scroll event on the fixed element and pass it to the main document seamlessly like: