SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Dec 2005
    Posts
    964
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Start onload in middle of page?

    I know this headline doesn't make any sense but what I want to acomplish is if I have a page which is way longer than the browserwindow, lets say twice the height I want to, when loaded to start at the midle with 25% of the page above the browser window and 25% below...

    Can this be done?

    Thanks in advance :-)

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,700
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by jmansa View Post
    I know this headline doesn't make any sense but what I want to acomplish is if I have a page which is way longer than the browserwindow, lets say twice the height I want to, when loaded to start at the midle with 25% of the page above the browser window and 25% below...

    Can this be done?
    Yes it can be done. When you subtract the height of the browser window from the height of the page, what remains is what is above and below the visible window. So half of that is where you would scroll to.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •