跳过主要内容

.direction

.direction: 数值

[只读] 反映即时滚动方向,其中1是向前,-1是向后。

细节

[只读] 反映即时滚动方向,其中1是向前,-1是向后。

示例

ScrollTrigger.create({
trigger: ".trigger",
start: "top center",
end: "+=500",
onUpdate: (self) => console.log("direction:", self.direction),
});
无噪 Logo
无噪文档
中文文档 · 复刻官网
查看所有 ↗