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. Advertising

  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. Advertising

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. Replies:
    2
    Views:
    1,282
    Adrienne
    Feb 13, 2005
  2. Terren

    Resize popup window to fit text

    Terren, Sep 28, 2005, in forum: ASP General
    Replies:
    4
    Views:
    259
    Evertjan.
    Sep 29, 2005
  3. Jens Peter Hansen
    Replies:
    7
    Views:
    560
    Randy Webb
    Jun 19, 2004
  4. Raffi
    Replies:
    4
    Views:
    242
    Dr John Stockton
    Aug 12, 2004
  5. Replies:
    1
    Views:
    136
    PDannyD
    Apr 11, 2005
Loading...

Share This Page