Share Posted November 3, 2021 I've only just started looking into gsap and encountered this error (gsap.min.js:10 GSAP target .one not found. https://greensock.com) in my code? Not sure what i am doing wrong? Thanks See the Pen eYEyEKR by lankolas (@lankolas) on CodePen Link to comment Share on other sites More sharing options...
Author Share Posted November 3, 2021 ok, so this works in code pen but not in VSC and chrome ? Link to comment Share on other sites More sharing options...
Solution Solution Share Posted November 3, 2021 Welcome to the forums @TheAmbiguousPitchfor It's best to put all your script tags before the end of the closing <body> tag. When you put them up top, the DOM isn't ready, so the element you are trying to target doesn't exist. <html> <head> <link rel="stylesheet" href="style.css"> </head> <body> <div class="one"> </div> <div class="two"> </div> <div class="three"> </div> <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.8.0/gsap.min.js"></script> <script src="001.js"></script> </body> </html> 2 1 Link to comment Share on other sites More sharing options...
Author Share Posted November 3, 2021 Thank you @OSUblake. I'm having one of those days and i knew it was something simple! This worked for me ! 2 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now