Jump to content
Search Community

This GSAP script works on CodePen, but not in my VSCode

Hasan- test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

I am a total beginner and trying to introduce the animation to image carousel as is on this page. After running around the web I found this query on GSAP, implemented the code and it started working. BUT the active code in my pen does not work in VSCode, although it works on CodePen, the other one which I have "commented"  does work in my VSCode. 

 

Could someone please look into this and guide me why is this so?
Moreover I would also like to request to know which technique for scroll trigger image carousel animation exactly has been used on this page.

 

Many thanks! 

See the Pen bGZbzmo by Hasan_0 (@Hasan_0) on CodePen

Link to comment
Share on other sites

7 minutes ago, GreenSock said:

It looks like you had syntax errors in your JavaScript, so it halted execution. Totally unrelated to GSAP.  To end your commented-out code, you had this: 

\**

 

Instead of this: 

**/

 

 

 

I hope that gets you going in the right direction. Enjoy!

Kind of you to respond. It works now.

 

There is some change I want to make to the animation: WHEN SCROLLING DOWN I want the carousel to start moving to left as soon as it comes into viewport and keep doing so while page is being scrolled down and end only when it exits viewport, whereas, WHEN SCROLLING BACK UP I want the carousel to start moving from left to right as soon as it comes into viewport and keep doing so while page is being scrolled up and end only when it exits viewport.

 

Could you please guide how to get this done?

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