开发者

Prevent browser scrolling to hash on page load

开发者 https://www.devze.com 2023-04-06 17:13 出处:网络
Using localscroll on ready but the browser snaps to hash on ready. How do I prevent that and have it scroll to the top no matter what?

Using localscroll on ready but the browser snaps to hash on ready. How do I prevent that and have it scroll to the top no matter what?

if this is not possible. How do you offset the position of the window.locati开发者_如何学运维on of hash?


Use $(window).scrollTop(0);

$(function(){
    $(window).scrollTop(0);
});
0

精彩评论

暂无评论...
验证码 换一张
取 消