A partial archive of discourse.wicg.io as of Saturday February 24, 2024.

An onscrollstop event

Edwin_Reynoso
2015-04-19

I believe if there were a onscrollstop Event websites which load content when scrolling like facebook, twitter, google+ and others would be a lot more responsive.

As of right now they are using a scroll handler, which the function gets called each time the document is scrolled.

If there were a onscrollstop event they could run it once after the document has stopped being scrolled and called once (or how many times the scrolling stops).

So if I’m scrolling and I scroll all the way down to load more content once I stop scrolling the event fires and new content can be loaded. Wouldn’t that be more proficient.

Or a onscrolltop and onscrollbottom or named something else onscrolledtotop and onscrolledtobottom.

Meaning when scrolled all the way to the top run function, and when scrolled all the way down. Not sure how that would work. Just an idea.

simevidas
2015-07-06

Such a “scrollstop” event can be achieved with event debouncing. It’s simple to implement in JavaScript, but I would like to have it as a built-in feature as well. (Same for event throttling.)

RickByers
2015-07-19

I agree this is pretty simple to implement for touch screens (most browsers you can wait for touchend). But there is no good solution for touchpads. scrollstop might be hard to define for atomic scrolls like keyboard, wheel and JS-driven scroll animations. Maybe some information in the scroll event would be better?

We’ve been thinking of exposing scroll phase as part of scroll customization.