onEnter
– forward past “start” (typically whentrigger
is scrolled into view)onLeave
– forward past “end” (typically whentrigger
is scrolled out of view)onEnterBack
– backward past “end” (typically whentrigger
is scrolled back into view)onLeaveBack
– backward past “start” (typically whentrigger
goes backward out of view)onUpdate
– every time the scroll position changes while between “start” and “end”.onToggle
– passes the start or end in either directiononRefreshInit
– immediately before measurements are recalculated (typically on resize)onRefresh
– after measurements are recalculated (typically on resize)
Callbacks
When this panel’s top edge reaches 100px from the top of the viewport, the ScrollTrigger will start (start: "top 100px"
), then end when its bottom is 100px from the bottom of the viewport (end: "bottom bottom-=100px"
). Callbacks are logged to the right, and progress below:
progress: 0
All callbacks receive one parameter – the ScrollTrigger instance itself which has properties like progress
, direction
, and isActive
.