When you pass a duration to a Scene, the Scene actually starts 1px after the triggerElement.
This is not the case when duration is not passed in.
I had a look a the code, and I think this is because how newProgress is calculated and later evaluated.
if (_options.duration > 0) {
newProgress = (scrollPos - _scrollOffset.start) / (_scrollOffset.end - _scrollOffset.start);
} else {
newProgress = scrollPos >= _scrollOffset.start ? 1 : 0;
}
Here you can see that:
- when duration > 0 and scrollPos equals _scrollOffset.start, newProgress will be 0.
- when duration <= 0 and scrollPos equals _scrollOffset.start, newProgress will be 1.
When you pass a duration to a Scene, the Scene actually starts 1px after the triggerElement.
This is not the case when duration is not passed in.
I had a look a the code, and I think this is because how newProgress is calculated and later evaluated.
Here you can see that: