Closed CallumBrankin closed 6 years ago
Hey @CallumBrankin
I'm getting the sense that the way options.viewFactor
behaves doesn't match your expectations, but I'm not sure I understand what's going on. Do you mind creating a JSBin demo to better help me understand your problem?
@jlmakes I'll attempt to recreate it in JSBin
I just wanted to go on a quick detour to explore options.viewFactor
before getting into your issue.
Callum,
You're using ScrollReveal on a really really really tall element, and options.viewFactor = 0.06
means that 6% of its height must be past the bottom boundary before it's revealed—which on my screen, meant I had to scroll before anything was visible.
I would recommend options.viewFactor = 0
.
That will guaranteed the text will be visible on page load... now let's look into why there's no animation.
"The main body of text is visible but doesn't animate in on page load."
Turns out, the div.panel.panel-narrow
that you're revealing (which contains your really really tall content), also has a blanket CSS transition applied to it:
.page .panel {
transition: all .3s ease-in-out;
}
I obviously have no idea what this is for in your project, but in this situation it is conflicting with ScrollReveal's CSS transitions, and preventing the initial animation from playing.
Good luck!
@jlmakes Thanks for the clarification!
When a large element is within the view factor percentage on page load, ScrollReveal will not trigger the reveal animation on that element.
The section element in question is 1841px in width and 3090px in height in desktop view. 311px width and 7868px height in mobile view (iPhone 7).