SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2002
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Center pop up window

    Hi,

    I am using the perfect pop up window script from this site and I want to edit it so the window pops up in the center of the screen om all screen resoultions. At the moment the pop up in some case is half off the screen which is annoying. Can someone please some me how to edit this code:

    var newWin = null;function popUp(strURL, strType, strHeight, strWidth) { if (newWin != null && !newWin.closed) newWin.close(); var strOptions=""; if (strType=="console") strOptions="resizable,scrollbars,height="+ strHeight+",width="+strWidth; if (strType=="fixed") strOptions="status,height,scrollbars,="+ strHeight+",width="+strWidth; if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,"+ "resizable,location,height="+ strHeight+",width="+strWidth; newWin = window.open(strURL, 'newWin', strOptions); newWin.focus();}

    ><a href="link.htm" onclick="popUp(this.href,'console',500,300);return false;" target="_blank">

  2. #2
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Lancaster, PA
    Posts
    3,019
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Hi ya Jason

    I was just looking at this today, but haven't played with it to tell you if it'll do what you want. Take a look at
    http://www.dynamicdrive.com/dynamici...autocenter.htm and let me know how it works for you.

    Cheers,

    Steve
    Web Designer or Small Business Owner?
    Need More Leads and More Clients?
    Get Free Marketing Tips, Tricks and Ideas Here!

  3. #3
    SitePoint Enthusiast
    Join Date
    Dec 2002
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Steve,

    That's exactly wanted I wanted. It centers the window perfectly in the window for different screen resolutions.

    Thanks again,

    Jason

  4. #4
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Lancaster, PA
    Posts
    3,019
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Hey - you're welcome!

    Glad it works for you. I'll have to play around with it myself this weekend.

    Enjoy the weekend - Steve
    Web Designer or Small Business Owner?
    Need More Leads and More Clients?
    Get Free Marketing Tips, Tricks and Ideas Here!


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
  •