Search code examples
htmlcssalignmentpageload

Webpage: Load centered at specific point


I am making a website with fixed positions and where my div configuration is very unorthodox. The current size of the page is 1450 x 900. What I want to do is to somehow make the page load with a starting point different than top:0; left:0. So, assume that you have a resolution of 1024 x 768 in your browser, I would like the page to load in such a way where you don't see the first 1024 pixels (out of the 1450) and the first 768 pixels (out of the 900) but rather, let's say the 300-1324px in width and the 100-868px in height.

I hope you understand what I am trying to describe, if not please do ask me for clarifications.

Any help is much appreciated! Thank you in advance.


Solution

  • Using javascript:

    var xcoord = 100,
    ycoord = 300;
    window.scroll(xcoord, ycoord);
    

    The coordinates are where you want the top-left corner of the browser window to load.