SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    Jules
    SitePoint Community Guest
    Anyone know how to detect the current position of the window? I want to pop up a new window in exactly the same position.

  2. #2
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi jules,

    window.screen.availTop & window.screen.availLeft provide the respective coordinates of the current window. NN also has innerWidth/outWidth, etc. You would then have to use window.moveTo(x,y) to place the window.

    But...if you intend a pop a window in the exact location, what's wrong with a simple: location.href='blahblah'?

    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still

  3. #3
    Jules
    SitePoint Community Guest
    mmmm...

    availTop and availLeft gives you the top left corner of the screen which IS appropriate when the browser is maximised.

    But...

    If the browser window is floating somewhere on the screen and not maximised (as it is with most people running their res greater than 1024 x 768) availTop and availLeft aren't much help.

    I suspect there is no way to get the current cooridinates of a non-maximised browser window.

    If you know otherwise you will rock my world!


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
  •