Howto correct resize a popup window (cross Browser)

Discussion in 'Javascript' started by GTi, Feb 5, 2006.

  1. GTi

    GTi Guest

    Does anyone have a script to resize a (popup) window that is cross
    browser compatible.
    What I realy need is to resize a windows based on the INNER size.

    function SetWindowSize(w,h)
    {
    try
    {
    top.innerWidth=w;
    top.innerHeight=h;
    }
    catch(e)
    {
    top.resizeTo(w,h);
    }
    LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
    TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
    self.moveTo(LeftPosition,TopPosition);
    }

    With this script the size is different on IE and FF.
     
    GTi, Feb 5, 2006
    #1
    1. Advertisements

  2. GTi wrote:

    > Does anyone have a script to resize a (popup) window that is cross
    > browser compatible.


    I have one but it no longer works reliably. Since resizing windows
    can be prevented by the user, this is no longer a viable approach.

    > What I realy need is to resize a windows based on the INNER size.
    >
    > [...]
    > LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
    > TopPosition = (screen.height) ? (screen.height-h)/2 : 0;


    Nonsense.


    PointedEars
     
    Thomas 'PointedEars' Lahn, Feb 5, 2006
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mel
    Replies:
    4
    Views:
    2,985
  2. Replies:
    2
    Views:
    1,475
    Adrienne
    Feb 13, 2005
  3. Terren

    Resize popup window to fit text

    Terren, Sep 28, 2005, in forum: ASP General
    Replies:
    4
    Views:
    346
    Evertjan.
    Sep 29, 2005
  4. Jens Peter Hansen
    Replies:
    7
    Views:
    868
    Randy Webb
    Jun 19, 2004
  5. Raffi
    Replies:
    4
    Views:
    468
    Dr John Stockton
    Aug 12, 2004
  6. Replies:
    1
    Views:
    217
    PDannyD
    Apr 11, 2005
  7. Nigel Molesworth

    Resize an existing popup window

    Nigel Molesworth, Jun 24, 2005, in forum: Javascript
    Replies:
    0
    Views:
    231
    Nigel Molesworth
    Jun 24, 2005
  8. James Black

    user can't resize popup window in IE

    James Black, Apr 27, 2006, in forum: Javascript
    Replies:
    5
    Views:
    343
    James Black
    May 2, 2006
Loading...