Neg Posted August 9, 2021 Posted August 9, 2021 Hello, While I was testing this example in my own website with different browser, I noticed that it scrolls very smooth in Firefox (like the example in the codepen) but in Edge and Chrome no matter what ease I choose or how long the duration is, scroll is not smooth, I see that #Section suddenly jump under navigation bar and this is very annoying. Do you know how can I solve this? Thanks See the Pen LkOrKY by GreenSock (@GreenSock) on CodePen.
Cassie Posted August 9, 2021 Posted August 9, 2021 Hello @Neg - Are you sure it's working? It sounds likely that you're not preventing default and using anchor links? Maybe you have smooth scrolling enabled in firefox globally or a smooth scroll extension? If you're *sure* it's working could you post a minimal demo showing the issue, it's quite hard to debug blind. Thanks!
Neg Posted August 9, 2021 Author Posted August 9, 2021 Hi @Cassie, I am trying it on my local host and don't know how I can make a demo of it. I just copied the same css, html and js code from above link and I see the differences in different browser. Do you know why?
Neg Posted August 9, 2021 Author Posted August 9, 2021 18 minutes ago, Cassie said: Are you sure it's working? I don't understand what you mean?
Cassie Posted August 9, 2021 Posted August 9, 2021 *are you sure the scrollTo plugin is actually loaded and animating. It sounds like what you're seeing is the default browser behaviour for anchor links. Pen linked below - If not and it is animating inconsistently please provide a demo as this example is working perfectly in both chrome and firefox. We can't debug a working demo I'm afraid. We need to be able to see what you're doing differently. See the Pen 8b2f8a0d35a2f8d61c1a6e6040c789a6?editors=1010 by cassie-codes (@cassie-codes) on CodePen. 1
Neg Posted August 9, 2021 Author Posted August 9, 2021 I don't know how to use codepen for WordPress. For ScrollToPlugin I used CDN.
Solution OSUblake Posted August 9, 2021 Solution Posted August 9, 2021 Try getting rid of this in your CSS. :root { scroll-behavior: smooth; } 2
Neg Posted August 9, 2021 Author Posted August 9, 2021 6 minutes ago, OSUblake said: :root { scroll-behavior: smooth; } I cannot find it in my CSS!
Neg Posted August 9, 2021 Author Posted August 9, 2021 Thanks a lot! This fixed the issue. :root { scroll-behavior: inherit; } 2
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