Share Posted September 1, 2022 I have a section('.sec-3'), I pin it to fixed in view, and it has 3 items('.scroll-trigger-item') to scroll horizontally when scrolling. I loop the items array but just one item works (the first item). Please help me to fix code to make other items work except the last item(make the last item stop in view's center), thanks! See the Pen rNvBKgE?editors=1000 by jackyyang (@jackyyang) on CodePen Link to comment Share on other sites More sharing options...
Share Posted September 1, 2022 I assume you wanted something like this?: See the Pen gOzOYRM?editors=0010 by GreenSock (@GreenSock) on CodePen There are a bunch of demos at https://greensock.com/st-demos which may be helpful. 1 Link to comment Share on other sites More sharing options...
Author Share Posted September 2, 2022 Thanks for the answer! And I notice that See the Pen JjYPgdp by GreenSock (@GreenSock) on CodePen is not working, can you fix that? Thanks. Link to comment Share on other sites More sharing options...
Share Posted September 2, 2022 What do you mean it's not working? What isn't working exactly? I don't notice any problems at all. Maybe I'm missing something obvious(?) Link to comment Share on other sites More sharing options...
Author Share Posted September 2, 2022 I misunderstand the demo😅. I thought when scrolling to the section and keep scrolling , the item will scroll automatically to the left(like my demo), definitely it's not works as I thought. I'm sorry about that, the demo works just fine and great!🤩 By the way, there's another question about my demo. As the item height is short, is there any solution to make it looks "natural"? I want the pined section('.sec-3') looks like pinning in view, until scroll to the end of '.scroll-trigger'. Now, it looks like '.sec-3' is moving down. Thanks! See the Pen GRdRpwG?editors=1010 by jackyyang (@jackyyang) on CodePen Link to comment Share on other sites More sharing options...
Solution Solution Share Posted September 3, 2022 Sure, just pin the container element instead: See the Pen yLjLmZV by GreenSock (@GreenSock) on CodePen 1 Link to comment Share on other sites More sharing options...
Author Share Posted September 5, 2022 Thanks for the answer🥰 1 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