最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

javascript - Smooth scrolling when clicking Anchor Link - Stack Overflow

matteradmin6PV0评论

I am working on a WordPress website that a client came to me with. He is requesting that all scroll speeds for anchors links match.

If you go to the home page here: / and click on Learn More under LET THE ADVENTURE BEGIN. The page scrolls down to the next section nicely.

Now if I click on Write Review next to the stars in a product (/) it just jumps to the bottom instantly. The client wants the scroll for the first link.

First, how to I change the scroll speed?

Second, will it even work? The reviews e from a third party called Yotpo. Is it possible to change the scroll speed on this link that is embedded from third party software?

I am working on a WordPress website that a client came to me with. He is requesting that all scroll speeds for anchors links match.

If you go to the home page here: https://www.lakeshoresup./ and click on Learn More under LET THE ADVENTURE BEGIN. The page scrolls down to the next section nicely.

Now if I click on Write Review next to the stars in a product (https://www.lakeshoresup./product/pathfinder/) it just jumps to the bottom instantly. The client wants the scroll for the first link.

First, how to I change the scroll speed?

Second, will it even work? The reviews e from a third party called Yotpo. Is it possible to change the scroll speed on this link that is embedded from third party software?

Share Improve this question edited Jan 19, 2022 at 13:55 Kalnode 11.5k3 gold badges40 silver badges74 bronze badges asked Oct 7, 2020 at 16:10 MattMatt 3211 gold badge6 silver badges17 bronze badges 1
  • FYI, the answers don't actually give you control over scroll speed, they merely apply a default browser speed. – Kalnode Commented Jan 19, 2022 at 13:55
Add a ment  | 

2 Answers 2

Reset to default 6

you can add in css a general scroll behavior for the entire website to scroll smoothly like:

* {
  scroll-behavior: smooth;
}

You can use smooth scroll behavior. It's enable smooth scrolling for the whole page.

html {
  scroll-behavior: smooth;
}
Post a comment

comment list (0)

  1. No comments so far