PDA

Click to See Complete Forum and Search --> : resizeTo 2/3


landon11
Aug 16th, 2001, 12:37 PM
I want to position the popup in the center of the screen and 2/3 the size of the screen?

Ive tried this:

w=Math.round(screen.availheight*2/3);
h=Math.round(screen.availwidth*2/3);
t=(screen.availheight/2)-(h/2+5)
l=(screen.availwidth/2)-(w/2+25)
resizeTo(w,h)
moveTo(t,l)

but it came out about half the width of the screen and almost full hieght. It also was positioned in the lower left with the bottom 1/3 off the screen.

Thank you

scoutt
Aug 16th, 2001, 01:50 PM
try this

<script>
function resize() {
window.resizeTo(window.screen.width * 2/3 ,window.screen.height * 2/3 );
}
</script>

landon11
Aug 16th, 2001, 03:13 PM
Thank you,
That got the size but I came up with this to get the positioning in case anyone wants to know:

h=(window.screen.availHeight * 2/3);
w=(window.screen.availWidth * 2/3);
t = (screen.width) ? (screen.width-w)/2 : 0;
l = (screen.height) ? (screen.height-h)/2 : 0;
resizeTo(w,h)
moveTo(t,l)

Thanks