Are there any example of binding an animation to a scroll event?
I don't think the docs contain an example for triggering an animation on scroll, but you can repurpose the seek example to fire on a scroll event.
As @alexchantastic said, you can just use the seek property. For ScrollMagic specifically, something like this works:
// Assuming you've already set up your scroll magic controller and anime timeline
// var timeLine = anime.timeline({...});
new ScrollMagic.Scene({
duration: timeLine.duration
}).on('progress', function(event){
timeLine.seek(timeLine.duration * event.progress)
});
For a manual approach, just trigger the timeline seek on scroll.
Most helpful comment
As @alexchantastic said, you can just use the seek property. For ScrollMagic specifically, something like this works:
For a manual approach, just trigger the timeline seek on scroll.