简体   繁体   English

单击锚链接时的滚动速度

[英]Scroll Speed when clicking Anchor Link

I am working on a WordPress website that a client came to me with.我正在一个客户来找我的 WordPress 网站上工作。 He is requesting that all scroll speeds for anchors links match.他要求锚链接的所有滚动速度都匹配。

If you go to the home page here: https://www.lakeshoresup.com/ and click on Learn More under LET THE ADVENTURE BEGIN.如果您转到此处的主页: https : //www.lakeshoresup.com/并单击 LET THE ADVENTURE BEGIN 下的 Learn More。 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.com/product/pathfinder/ ) it just jumps to the bottom instantly.现在,如果我单击产品 ( https://www.lakeshoresup.com/product/pathfinder/ ) 中星星旁边的“写评论”,它会立即跳到底部。 The client wants the scroll for the first link.客户想要第一个链接的滚动。

First, how to I change the scroll speed?首先,如何更改滚动速度?

Second, will it even work?其次,它甚至会起作用吗? The reviews come from a third party called Yotpo.评论来自名为 Yotpo 的第三方。 Is it possible to change the scroll speed on this link that is embedded from third party software?是否可以更改从第三方软件嵌入的此链接的滚动速度?

you can add in css a general scroll behavior for the entire website to scroll smoothly like:您可以在 css 中添加整个网站的一般滚动行为,以平滑滚动,例如:

* {
  scroll-behavior: smooth;
}

You can use smooth scroll behavior.您可以使用平滑滚动行为。 It's enable smooth scrolling for the whole page.它为整个页面启用平滑滚动。

html {
  scroll-behavior: smooth;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM