Jump to content
GreenSock

ytrabelsi

AP target #app > div not found.

Moderator Tag

Recommended Posts

Hi, 
i'm trying to make a parallax effect on the background. 

i"m trying to access to div using the class generated by react 

when i load the page the script run but the gsap code shows an error 

but when i copy paste the same script i runs well 

image.thumb.png.8862ab62852a17b68eba641860ca312f.png

image.png.7fad637734ccaff3b46163333df345ad.png

image.thumb.png.ab61bd990bd471fadd5c3abe6bad54b1.png

 

See the Pen ExdvjeB by ytmicrocom (@ytmicrocom) on CodePen

Link to comment
Share on other sites

It sounds like you must be calling that code when the element doesn't actually exist.

 

It's pretty tough to troubleshoot without a minimal demo - the one you provided doesn't illustrate the issue properly. Well, it does but obviously it's because your element doesn't exist. 

 

Would you please provide a very simple CodePen, Stackblitz or CodeSandbox that demonstrates the issue? 

 

Here's a Stackblitz starter template that you can fork - it already imports GSAP/ScrollTrigger and shows how to use gsap.context()

 

Please don't include your whole project. Just some colored <div> elements and the GSAP code is best.

 

Once we see an isolated demo, we'll do our best to jump in and help with your GSAP-specific questions. 

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