[Resolved] Smooth scroll problem on Chrome-based browsers

Home Forums Support Smooth scroll problem on Chrome-based browsers

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1470994
    Viktor

    Hi,
    I have edited the smooth scroll duration to be 2500ms and it works great in Firefox. In Chrome, however, the scrolling exhibits a very odd behavior of hanging at the beginning and then jumping to the anchor.
    You can see the problem by clicking the “Buy now” button in the link below.

    I spent hours trying to figure it out with no success. What could be going wrong?
    Thanks!

    #1471944
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    I just took a look at the script we use for smooth scroll and I’m not sure what could be causing that. It could come down to how the browser calculates the time you’ve set – I couldn’t see a solution, unfortunately. Does the same thing happen on a blank page with nothing but text?

    It also looks like the script is no longer being maintained as there’s a CSS-only method that’s widely supported now (scroll-behavior: smooth). We may opt to go the CSS route in the future instead of JS, which means things like the scroll duration would likely go away.

    #1472111
    Viktor

    Thanks for the reply Tom!
    I just figured it out. Apparently it is caused by including the css for the rellax-js parallax library
    <link rel="stylesheet" type="text/css" href="/wp-content/custom_code/rellax-master/css/main.css">
    Luckily, this css is not needed for the functioning of the parallax so I removed that line.

    #1472137
    Tom
    Lead Developer
    Lead Developer

    Aha – glad you found the culprit. Thanks for letting me know 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.