GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||
GeezerVison is showing wicg.github.io — overscroll and scrollend events The new scroll events introduced in this document provide web developers a way to listen to the state of the scrolling and when their content is being overscrolled or when the scrolling has finished. This information will be useful for the effects such as pull to refresh or history swipe navigations in the web apps. IntroductionWith CSS overscroll behavior property developers can prevent user-agent defined default boundary actions. Overscroll affordance (e.g. rubber-banding or glow effect), pull to refresh, and history swipe navigation are examples of default boundary actions. Overscroll behavior property lets developers to prevent default aformentioned boundary actions. However in order to implement customized behaviors, they still need to register a combination of scroll, touch, wheel event listeners to find out when overscrolling has started and trigger their customized scroll boundary behavior. This approach has the following disadvantages/limitations:
The
|
| Type | overscroll |
|---|---|
| Interface | OverscrollEvent |
| Sync / Async | Async |
| Bubbles | Yes if the target is Document |
| Trusted Targets | Element, Document |
| Cancelable | No |
| Composed | Yes |
| Default action | None |
Note that similar to scroll event,
overscroll and scrollend events bubble if fired at document.
Similarly the overscroll and scrollend events are async, non-cancelable, and do not have any default actions.
To prevent default boundary actions developers must use CSS overscroll behavior property.
GlobalEventHandlers interfaceThe following section describes extensions to the existing GlobalEventHandlers interface, defined in [[!HTML5]], to facilitate the event handler registration.
partial interface GlobalEventHandlers {
attribute EventHandler onoverscroll;
attribute EventHandler onscrollend;
};
overscroll event type.
scrollend event type.