Share Posted March 24, 2022 I'm having some issues with basically imitating jqueries slideToggle ( which didn't work well ) and using scrollTo to try and solve the problem. The goal is to click on the button ( just click on the first button ) and to have the content expand down below WITHOUT scrolling down. This works if you are towards the top of the div - before your scrollbar has gotten to the button. But if you scroll past the button and click, it moves you down to the bottom of the page. ( you can see it without my hack if you comment out these lines ) : gsap.to(window, {duration:.1, scrollTo:currScroll}); gsap.to(window, {duration: 2, scrollTo: currScroll}); I'm trying to scroll jack and force it from moving down when it expands - any suggestions? See the Pen bGaBybE by pwhittemore (@pwhittemore) on CodePen Link to comment Share on other sites More sharing options...
Solution Solution Share Posted March 24, 2022 Hi pdub, I'm not sure what you're looking for, but another way would be to just keep setting the scroll position while it's animating. See the Pen wvpgwOe by GreenSock (@GreenSock) on CodePen 3 Link to comment Share on other sites More sharing options...
Author Share Posted March 24, 2022 Damn son. That's it. 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