【问题标题】:Jquery: When an #ID is at the end of a url, the page appears with the element at the top of the browser screen, can we make it scroll to #ID element?Jquery:当 #ID 在 url 的末尾时,页面出现在浏览器屏幕顶部的元素,我们可以让它滚动到 #ID 元素吗?
【发布时间】:2011-02-01 07:39:43
【问题描述】:
转到我在问题末尾链接的页面,将您发送到主 stackoverflow 页面,但浏览器不会显示页面顶部,它将查找 #h-recent-badges 元素并开始查看该元素位置的页面。
是否有可能做到这一点,如果有人通过文章底部的某个 cmets 的链接访问我的网站,它会在页面顶部启动该人,然后向下滚动到#ID,而不是仅仅出现在#ID?
当在页面上单击锚链接时,我可以使页面滚动到 #ID,但我说的是当有人来自谷歌并带有指向元素 #ID 的链接时。
https://stackoverflow.com/#h-recent-badges
【问题讨论】:
标签:
jquery
scrolltop