BhaskarG Posted July 19, 2023 Share Posted July 19, 2023 Hello, I want to achieve a news app like carousel on a website. I found similar carousel example code pen in GSAP Observer plugin samples but I not familiar how to stop Observer plugin loop in the given code pen example. please guide me. Thanks in advance. See the Pen XWzRraJ by GreenSock (@GreenSock) on CodePen Link to comment Share on other sites More sharing options...
mvaneijgen Posted July 19, 2023 Share Posted July 19, 2023 I'm not completely sure what it is you're asking, but maybe you're looking for this. In this pen the observer plugin is active, but after a certain amount it will go over in normal scrolling behaviour. Hope it helps and happy tweening! See the Pen oNdNLxL by GreenSock (@GreenSock) on CodePen Link to comment Share on other sites More sharing options...
BhaskarG Posted July 19, 2023 Author Share Posted July 19, 2023 12 minutes ago, mvaneijgen said: I'm not completely sure what it is you're asking, but maybe you're looking for this. In this pen the observer plugin is active, but after a certain amount it will go over in normal scrolling behaviour. Hope it helps and happy tweening! @mvaneijgen Thanks for the reply. My concern is regarding looping through sections in the example in the code pen. There are 5 sections in the html , but after section 5, it loops back to section 1. I do not want this loop behavior. Could you please guide me on how to remove the loop? Link to comment Share on other sites More sharing options...
mvaneijgen Posted July 19, 2023 Share Posted July 19, 2023 2 minutes ago, BhaskarG said: Could you please guide me on how to remove the loop? That is what the example I've shared is doing. Check the function gotoPanel() there it checks if it is at the end of the loop and then brakes the observer. 1 Link to comment Share on other sites More sharing options...
akapowl Posted July 19, 2023 Share Posted July 19, 2023 This thread contains an example for how to achieve a non-looping variant of the Observer Plugin example you posted, @BhaskarG 1 Link to comment Share on other sites More sharing options...
BhaskarG Posted July 19, 2023 Author Share Posted July 19, 2023 @mvaneijgen, @akapowl Thankyou for suggestions 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