Jump to content
Search Community

ScrollTrigger targeting sections and then text

agsymonds test
Moderator Tag

Recommended Posts

Hi,

 

I have repeating section using the same classes, but with different content (backgrounds and copy). I want the background to appear on scroll, and then for the text to also appear, maybe +1 seconds after the background appears. 

 

I have managed to use "gsap.utils.toArray('.section');" for the sections which are triggered on scroll and they work well. If I want do the same for text within each section, do I need to repeat the array process adding a different trigger to target the text class to trigger for each instance or is there a simpler way?

 

TIA

See the Pen BaqrVgg by agsymonds (@agsymonds) on CodePen

Link to comment
Share on other sites

Hi, if I add more than one <p> element to each section, only the first <p> element is affected by the .from and not both <p>, although both have the same class.

 

 

I could wrap all <p> elements in a div and target that div, but I assume that there is a simpler way to target each individual <p> element?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...