Vue Scrollama
A Vue component to easily setup scroll-driven interactions (aka scrollytelling). Uses Scrollama under the hood.
Installation
Scrollama makes use of IntersectionObserver and you'll want to manually add its polyfill intersection-observer
for cross-browser support.
Basic Usage
Any elements placed directly inside a Scrollama
component will be considered as steps. As the user scrolls, step events will be triggered and emitted which you can handle as required.
Here's a simple example with three <div>
elements as steps and a step-enter
event
Sticky Graphic
To add a sticky graphic element to the mix (example), place it into a slot with name 'graphic'.
Scrollama Options
Props passed to the Scrollama
component will be passed on to scrollama's setup method as documented here.
- offset
- progress
- threshold
- order
- once
- debug
Multiple instances
If you have more than one Scrollama
components rendered at a time, you will need to pass on id
as a prop.