...

View Full Version : Control position and size of primary window



webdesign125
06-19-2002, 12:41 AM
Hi,

I have searched many places trying to find a script that allows me to center and specify the size of the primary window when someone enters the website. I have checked almost everywhere and found scripts that only allow you to control a secondary window. I would like my website to position itself in the center of the user's screen and only be the size that i specify. Can anyone help me out?

Thanks in advance

M

justame
06-19-2002, 01:44 AM
web...
/me seems to think it can onlyyy be controlled/positioned ifin' its just a window® YOUUU opened...aka secondary...:O((( sooo thattts why you probably just a cant® find some 'script' to do it for you...:O(((

JohnKrutsch
06-19-2002, 02:38 AM
You can specify the size and the position of the primary window:

<script type="text/javascript">

window.resizeTo(x,y) //where x=width in pixels and y=height in pixels
window.moveTo(l,t) //where l=left position in pixels and t=top position in pixels

</script>

justame
06-19-2002, 03:54 AM
john...
/me thought just a bout® that 'onload' script...
'cept then??? its nottt the window reallly that the viewer first just a sees® when they typein/goto www.domain.com

just a great® way to get just a round® using 'itself' to resize/position...vs /me was thinking of opening just a second® one...

just a nother® reason yourrre the mod n' /me still isnt just a programmed® to think...hehehe...

webdesign125
06-19-2002, 04:59 AM
thank you for the help.

I put the following code into my page and received and error stating that x was not defined:

<script type="text/javascript">

window.resizeTo(x,y) //where x="801" and y="324"
window.moveTo(l,t) //where l="300" and t="350"
</script>


What am I doing wrong?

JohnKrutsch
06-19-2002, 05:27 AM
Those where just comments to instuct you what to put there. You would do it like this:

<script type="text/javascript">
window.resizeTo(801,324);
window.moveTo(300,350);
</script>

or like this:

<script type="text/javascript">
x=801;
y=324;
l=300;
t=350;
window.resizeTo(x,y);
window.moveTo(l,t);
</script>

^KoalaBear^
06-19-2002, 02:31 PM
G'day Web..

I came across this earlier today and, in all honesty didnt understand the use on first thoughts, but I dragged it out of 'History' when I saw your question. If its not what youre after, please excuse the downunder newbie.. Just trying to be helpful... (and also live up to my tag LOL) :o

http://www.fo3nix.pwp.blueyonder.co.uk/scripts/centeralleg.htm

reached from:

http://www.fo3nix.pwp.blueyonder.co.uk/scripts.htm

Cheers!
KB...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum