Share Posted July 21, 2016 Hi everybody, So I'm playing around the latest GSAP SrollToPlugin and trying to recreate this sample published on the site: The issue I occurred is when I click on the navigation, the content will jump back to the top first then do the scroll, I found if I use the <button> instead of <li> then it works just fine. Does anyone knows what cause this issue? Thanks in advance. Here's the code: https://jsfiddle.net/cotyhsu/6rrdt6kw/3/ See the Pen LkOrKY by GreenSock (@GreenSock) on CodePen Link to comment Share on other sites More sharing options...
Share Posted July 21, 2016 That's not a bug - it's just that you set your <a> links to have an href of "#" which basically means "jump to the top of the current page". So it's obeying your instructions To get the effect you want, you could just make your href="javascript:" which essentially does nothing. 2 Link to comment Share on other sites More sharing options...
Author Share Posted July 21, 2016 Ah that's right... thanks for the 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