Tell me, please, what is the chrome setting for and how to disable it? When you open the site, it opens at the place where it was closed. And so with any site. In other browsers, sites open as usual first.
- It should be so. This is good. It seems in other browsers as well. - Qwertiy ♦
- the client simply wants his site to always open on top ... - aleks_sk
|
2 answers
Try running this code when the page loads.
window.scrollTo(0);
If you need to build it on all sites, not just on yours - use the Tampermonkey extension to add custom scripts to the site.
- Uncaught TypeError issued in console: window.scrollTo is not a function - aleks_sk
- when exactly did you run? After loading the page or when? It works for me, strange ... - David Manjula
- oneI immediately put it on the page at the top of the page)). It was necessary to hang on onload or simply add it to the bottom of the page. In principle, I realized that this is chrome, so it opens sites that have already been opened earlier. I will explain to the customer, if he all the same says that the site always opens up first, then I will already use your recommendation. Thank! - aleks_sk
- By the way, do you also have chrome opens at the same place the site where it was closed? - aleks_sk
|
In the beginning, you can break through this:
window.scrollTo({ top: 0 })
|