Home > Article > Web Front-end > How to make others display the middle of the webpage as soon as they open it?_html/css_WEB-ITnose
I am making a static page demo for a client. The image is very large, so there is a drag bar at the bottom of the browser. Every time I open the page, the leftmost one is displayed by default. Now I want to make it appear every time I open the page. The middle of the web page is displayed at any time, please give me the code~!
js first calculate the size of the screen, and then set the scrollTop and scrollLeft of the body
http://www .w3school.com.cn/htmldom/met_win_scrollto.asp
window.onload = function(){ scrollTo(250,0) }