Capítulo 286 de 411
A lightweight unified interface for detecting user interaction events (wheel, touch, pointer, scroll) across devices, without dealing with each event type's own quirks — often used as the input layer behind custom scroll-jacking or gesture-driven animations.
gsap.registerPlugin(Observer);
Observer.create({
target: window,
type: "wheel,touch,pointer",
onUp: () => console.log("up"),
onDown: () => console.log("down"),
});
type controls which underlying event categories are watched ("wheel", "touch", "pointer", "scroll"), each with different default behavior around when deltas are tracked.