简体   繁体   English

jQuery平滑滚动外部锚链接

[英]Jquery smooth scroll external anchor link

okay can you please help me with a peice of jquery code. 好吧,请您帮我提供一些jQuery代码。 Here is what i want to happen. 这是我想发生的事情。 My website is cyberfanatic.com right so. 我的网站是cyberfanatic.com。 So for example lets just use the footer for now. 例如,现在让我们使用页脚。 i have aa tag with the id of footer right. 我有一个带有页脚ID的标签。 so say if someone visits cyberfanatic.com/#footer right now the page will load and the then jump directly to the bottom of the page to where the anchor link with footer is. 假设如果有人现在访问cyberfanatic.com/#footer,则该页面将会加载,然后直接跳至页面底部,该页面会与定位脚链接。 How can i get it so that when the page cyberfanatic.com#footer loads that the page loads and the smooth scrolls to the anchor with the id of footer. 我如何获得它,以便当页面cyberfanatic.com#footer加载时页面加载,并且平滑滚动到带有footer id的锚点。 Please help me out. 请帮帮我。

使用scrollTo() 插件函数

$.scrollTo("#footerid");

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

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