Skip to content

struct

Scroll

pub struct Scroll {
    /* private fields */
}

A scroll trigger for a tween or timeline.

Methods

new

pub fn new(target: impl Into<Targets>) -> Scroll

Trigger on target scrolling into view ("top 85%" by default).

start

pub fn start(self, edge: &str) -> Scroll

Where it starts: an edge ("top 80%": the trigger's top at 80% down the viewport).

end

pub fn end(self, edge: &str) -> Scroll

Where it ends: an edge ("bottom 20%").

scrub

pub fn scrub(self, smoothing: f64) -> Scroll

Tie progress to the scroll position; smoothing seconds of lag (0 for none).

actions

pub fn actions(self, actions: &str) -> Scroll

GSAP toggleActions, e.g. "play reverse play reverse".

once

pub fn once(self) -> Scroll

Play once, then stop watching the scroll.

Trait implementations