Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent browser scrolling to hash on page load

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.location of hash?

like image 363
Tom Avatar asked Nov 13 '22 17:11

Tom


1 Answers

Use $(window).scrollTop(0);

$(function(){
    $(window).scrollTop(0);
});
like image 82
genesis Avatar answered Nov 16 '22 20:11

genesis