SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member Angel_chan's Avatar
    Join Date
    Jun 2001
    Location
    Ft. Worth, TX
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Pop-up Window/User-reslution

    Alright, I have been searching all over for the code or rather script to be able to do this :

    I have a pop-up window set for a certain resolution size. On a different resolution, it doesn't look right & you have to re-size it. I have seen & heard of a script or code that will have the pop-up window open in the size you wanted it to, even if the veiwer or user has a different resolution, so that it looks right. It will set the size of the window according to the viewer's/user's resolution.

    That's the best description I can do, If anyone knows tihs code/script PLEASE reply to this & let me know what it is & how to use it. Thanks!

    Angel_chan
    *Watashi wa kawaii desu*

  2. #2
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,123
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Um... screen.width and screen.height are the calls I think...

    So, it should be:

    offset=20;
    x=screen.width-offset;
    y=screen.height-offset;

    Then use the builder over at www.studiococo.com/index.asp?window.asp to generate the rest of the window opening call:

    function SC_openWin()
    {
    var newwin=window.open('about:blank','newwin','width=" + x + ",height=" + y + ",top=" + offset/2 + ",left=" + offset/2 + ",menu=no,toolbar=no,directories=no,status=no,scrollbars=no,,dependent=no');
    }

    The above code will make the new window 20 pixels smaller than your new window (if my screen.width and height are right) and then center it.
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  3. #3
    SitePoint Member Angel_chan's Avatar
    Join Date
    Jun 2001
    Location
    Ft. Worth, TX
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dunno if that'll help me any, So if I use what you suggested, that''l fix my pop-up window to where if I make it w/ a screen resolution of 1024x768 & set the window to be size 800x600, it will not be all messed-up looking if someone w/ an 800x600 screen resolution is viewing it?

    I need the script to set the window to the needed size depending on what screen resolution the visitor is using. So that it will look the same no matter what resolution you are using. Maybe I'm being dumb about this & not knowing how to do it or whatever, Thanks for replying.

    ~ Angel-chan
    *Watashi wa kawaii desu*


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
  •