Hasan- Posted December 21, 2023 Share Posted December 21, 2023 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 More sharing options...
Solution GreenSock Posted December 21, 2023 Solution Share Posted December 21, 2023 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: **/ See the Pen poYzYWB by GreenSock (@GreenSock) on CodePen I hope that gets you going in the right direction. Enjoy! Link to comment Share on other sites More sharing options...
Hasan- Posted December 21, 2023 Author Share Posted December 21, 2023 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 More sharing options...
GreenSock Posted December 21, 2023 Share Posted December 21, 2023 You mean like this?: See the Pen XWGrGyd?editors=0010 by GreenSock (@GreenSock) on CodePen 2 Link to comment Share on other sites More sharing options...
Hasan- Posted December 21, 2023 Author Share Posted December 21, 2023 3 minutes ago, GreenSock said: You mean like this?: Exactly this! Appreciate you! 1 Link to comment Share on other sites More sharing options...
GreenSock Posted December 21, 2023 Share Posted December 21, 2023 No problem. Happy to help. 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