How to reset the scrolling position when the page is updated?

Ie if you scrolled to the middle of the page and updated it, the browser remembers this position. It is required that when updating the scrolling starts from the beginning of the page.

You can implement the following custom code:

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

Need so? in body?

<script>
$(function() {
  $(this).scrollTop(0);
});
</script>

Just add it to the footer code, it needs to be called after jquery has loaded.

Try it on the body instead:

<script>
$(function() {
  $('body').scrollTop(0);
});
</script>

Not working, maybe i’m doing something wrong?

Hmm, weird, it’s not working for me either,

I just tried this in the console and it worked:

$('html, body').animate({scrollTop:0},500);

Edit: Keep the script tags and the document ready, just replace the 3rd line

Thank you very much! It worked! :slightly_smiling_face:

Great, can you mark the correct solution to close the thread?

@sam-g is this the same as the problem Im dealing with? It didnt work for me when I plugged it in.