Skip to main content

.direction

.direction : Number

[read-only] Reflects the moment-by-moment direction of scrolling where 1 is forward and -1 is backward.

Details

[read-only] Reflects the moment-by-moment direction of scrolling where 1 is forward and -1 is backward.

Example

ScrollTrigger.create({
trigger: ".trigger",
start: "top center",
end: "+=500",
onUpdate: (self) => console.log("direction:", self.direction),
});