Chybosky Posted November 15, 2023 Share Posted November 15, 2023 Hello Everyone! Trust you are doing well. I am current struggling with implementing smooth scroll on the anchor link on the progress bar. I would like for the section scroll smoothly to the section once the anchor link is clicked. Please what is the best way to achieve it? I sincerely appreciate any help provide. Thank you. See the Pen ZEwXeGp by Chybosky (@Chybosky) on CodePen Link to comment Share on other sites More sharing options...
Solution mvaneijgen Posted November 15, 2023 Solution Share Posted November 15, 2023 Hi @Chybosky Check out the demo below. The trick lies in the ScrollTo Plugin, see line 63. The code prevents default on click and then uses the scrollTo plugin to smoothly scroll to the desired location. See the Pen bGVjLwG?editors=0010 by GreenSock (@GreenSock) on CodePen 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