Jump to content
Search Community

when section enter the viewport

Lovestoned test
Moderator Tag

Recommended Posts

Hi

I want to animate .text2 div when 10% of .panel2 enter the viewport from bottom...I tried to give start:"top 90%" and "top 10%" to tl2 scrolltrigger but there is something wrong...I think I could not understand how scrolltrigger works yet...but if anyone can help me I'll be pleasure...I am confused...

See the Pen ZEBZbMd by ersenturgut (@ersenturgut) on CodePen

Link to comment
Share on other sites

8 minutes ago, Lovestoned said:

I want to animate .text2 div when 10% of .panel2 enter the viewport from bottom

To do this, use this structure:

gsap.to(".text2", { // Animate .text2
  // Whatever properties to animate here
  scrollTrigger: {
    trigger: ".panel2", // make .panel2 the trigger
    start: "10% bottom", // 10% of .panel2 enters the bottom of the viewport
    // Whatever other ScrollTrigger vars you need here
  }
});

I encourage you to go back through the ScrollTrigger documentation and video. 

  • Like 2
Link to comment
Share on other sites

Dear Zach

thanks for your reply...I am trying to learn it...just confused...at the beginning of my first animation I asked a question and tailbreezy suggested to make my animations in timeline...but now I learned what I have to do...thanks again...

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...