Howto correct resize a popup window (cross Browser)

G

GTi

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

Thomas 'PointedEars' Lahn

GTi said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top