SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Location
    Australia
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Pop up new window

    i need help...

    how can i make a new window pops up exactly in the middle/center? (in dreamweaver).

  2. #2
    SitePoint Enthusiast
    Join Date
    Jun 2001
    Posts
    83
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK, lets say you want a popup which has a width of 30% of the screen, roughly, this is what you should do:



    <script language="javascript">

    lefttoright = screen.widht;
    popupsize = lefttoright * 0.3;
    space = 0.5 * 0.7 * lefttoright;

    window.open...
    </script>

  3. #3
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    screen.width
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  4. #4
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Location
    Australia
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what i mean is like this, i have a link , and when viewers click on that link, it will pop up a small browser window (let say 200 X 150 ), but i want that new window pops up in the center.

  5. #5
    You talkin to me? Anarchos's Avatar
    Join Date
    Oct 2000
    Location
    Austin, TX
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    blah = window.open();
    blah.moveTo((screen.width - width)/2,(screen.height-height)/2);
    where width and height are the width and height of the popup window.
    ck :: bringing chris to the masses.

  6. #6
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Damn... You beat me to it, and it was exactly the same... Are you stealing my code again?
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright


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
  •