Forum Moderators: open

Message Too Old, No Replies

How to make browser with freezed size?

         

EricPoon

6:58 am on Jun 3, 2003 (gmt 0)

10+ Year Member



How to make the browser with desired window size when making webpage.

example: <edit>

Pls click "SL55"

[edited by: tedster at 4:30 pm (utc) on June 3, 2003]

RonPK

8:26 am on Jun 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello Eric, Welcome to WebmasterWorld.

Please note that according to the Terms of Service of this forum, it is not allowed to post URL's to examples. The forum would soon be completely spammed. A moderator will soon turn up and remove the link - unless you do it first.

As to your question: to open a new window with set width and height you need to include a bit of JavaScript like this:

<script type="text/javascript">
function myPop() {
window.open("yourURLhere",
"someWindowName",
"menubar=no,status=no,location=no,resizable=yes,scrollbars=no,width=780,height=570");
}
</script>

The script can be triggered for example by clicking on a link, like
<a href="#" onClick="myPop(); return false">show me</a>.

It is also possible to open the popup when the 'mother page' has finished loading, or even while it still is loading. IMHO this is bad design so I won't help you with that one :)

EricPoon

8:38 am on Jun 3, 2003 (gmt 0)

10+ Year Member



Hi RonPK,

Thanks for your reply.

Oh...! I'm a new comer here. Sorry for breaking the rule.

I've got the following script and wanna know, is it the same function?

<SCRIPT language=javascript>
<!--
if (navigator.appName == "Netscape" )resizeTo(760,647);
if (navigator.appName == "Microsoft Internet Explorer" )resizeTo(760,647)
//-->

<!--
wx = 640;
wy = 550;
x = (screen.width - wx ) / 2;
y = (screen.height -wy ) / 2;
if (navigator.appName == "Netscape" )moveTo(x,y);
if (navigator.appName == "Microsoft Internet Explorer" )moveTo(x,y);
//-->

Pls advice. Thanks.

tedster

4:39 pm on Jun 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



EricPoon, the two scripts are different.

Your script resizes and moves the existing window - it does not open a new window. RonPK's script opens a new window of the size and position you want, and leaves the first window open behind your new pop-up window.