最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Smooth scrolling when clicking Anchor Link - Stack Overflow

programmeradmin2浏览0评论

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;
}
发布评论

评论列表(0)

  1. 暂无评论