Results 1 to 2 of 2

Thread: Centered window

  1. #1
    Join Date
    Nov 2004
    Location
    Kent, England
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Centered window

    Can anyone help with a little problem?

    I know how to position a window by pixel co-ordinates, but how can I position a window (say centered) no matter what the screen resolution is

    Hope this is in the right forum

  2. #2
    Join Date
    Nov 2004
    Location
    Kent, England
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    Have just worked it out

    Quite simple really. If anyones interested:

    <script>

    var w=(screen.width-400)/2;
    var h=(screen.height-300)/2;

    window.open("something.html", "", width=400, height=300, left="+w+", top="+h+"")

    </script>

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
  •