SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast jared's Avatar
    Join Date
    Sep 2001
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    finding position of window




    How can I ascertain the position of the circled areas? I want to position a popup in the top right corner of the window...

    thanks,

    jared
    signature

  2. #2
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You will need to grab that using screen.width and screen.height.

    Code:
    <SCRIPT LANGUAGE="JavaScript">
    
    function NewWindow(mypage, myname, w, h, scroll) {
    var winl = (screen.width - w);
    var wint = (screen.height- h)/4;
    winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
    win = window.open(mypage, myname, winprops)
    if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
    }
    
    </script>
    Code:
    <a href="test.html" onclick="NewWindow(this.href,'name','400','400','yes');return false;">Popup</a>
    That is a rough idea. Remember though that those points you specify are going to vary depending on whether or not the browser is maximised and also how many toolbars they have open etc.

  3. #3
    SitePoint Enthusiast jared's Avatar
    Join Date
    Sep 2001
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    thanks for the reply...

    as I'm building a php file manager for uploads/downloads, and the popup was simply to show some data about the file, perhaps I'll use frames then. Or position it near the mouse... Any case, I would want it tidy...

    Thanks for the reply,

    jared
    signature


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
  •