Problems with scroll when loading page

0

Good evening. I have a problem with my page. When loading or reloading the scroll goes to the end of the page, it is normal to keep it up. Has something similar happened to me or could you help me to give me a solution? I use bootstrap.

Thanks in advance.

    
asked by dariot25 27.08.2017 в 02:07
source

1 answer

0

In the onload of your page you can make the scroll stay up.

First save the scroll as soon as you enter your page using the following:
var tempScrollTop = $(window).scrollTop();

This can be stored in a global variable or something similar. Then when loading or reloading the page you can retrieve the variable and modify the position of the scroll. $(window).scrollTop(tempScrollTop);

The language of the examples is Jquery, greetings!

    
answered by 02.02.2018 в 23:35