I will try this, but one quick addition, is this compatible with 3.0 versions of browsers?
Main Topics
Browse All TopicsIs it possible to have a pop-up window size itself percetage wise rather than by pixels. Becasue I have a scalable flash movie inside, and would like it to appear larger when necessary. Here is the code that I have that dreamweaver generated for me.
<script language="JavaScript">
<!--
function MM_openBrWindow(theURL,win
window.open(theURL,winName
}
//-->
</script>
and then this in the body tag
<body bgcolor="#0000CC" topmargin="0" leftmargin="0" onLoad="MM_openBrWindow('i
As I can tell, this is just the run of the mill open window script. So I understand the logic of it. However I don't understand how to use percentage values for its width and height. Again, is this possible? If so, I would appreciate the info. on how to do it.
Alan
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Ok, this is what I put:
<script language="JavaScript">
<!--
function MM_openBrWindow(theURL,win
th = window.screen.availHeight;
tw = window.screen.availWidth;
h = parseInt((th * 100)/100); // 100%
w = parseInt((tw * 30)/100); // 30%
window.open(theURL,winName
}
//-->
</script>
and then this for the body tag.
onLoad="MM_openBrWindow('i
I don't get any errors, and it is acting differently, but It doesn't seem to be working correctly, so I think that I didn't do something right.
Alan
I know how to resize the flash movie on the fly. I am asking how to resize the browser window on the fly. The fact that a flash movie will be in it is not important to the question. I just want to make sure that someone with a larger video setting doesn't get stuck with a pop up window that is only 300*400. I would like it to scale to the specific video display setting. And I believe CJ S has almost solved my problem, but Ithink I made a mistake in the above code.
Okay, sory for not explaining how to implement it:
<script language="JavaScript">
<!--
function MM_openBrWindow(theURL,win
h = window.screen.availHeight;
tw = window.screen.availWidth;
h = parseInt((th * height)/100);
w = parseInt((tw * width)/100);
window.open(theURL,winName
}
//-->
</script>
<body bgcolor="#0000CC" topmargin="0" leftmargin="0"
onLoad="MM_openBrWindow('i
That all should work properly!
Regards,
CJ
So is this right. I am still not getting it to worl. Now it doesn't even open the window.
ths = window.screen.availHeight;
tws = window.screen.availWidth;
hs = parseInt((ths * height)/100);
ws = parseInt((tws * width)/100);
window.open("intro.html","
And it says error on page.
I'm sorry I am having so much trouble.
Alan
And also CJ I'll give you extra points for this, but I know that the above code won't work for netscape 3or ie three, so could I use this code to give those browsers a static window, and then the upper versions will only resize.
Here is the code.
If (parseInt(navigator.appVer
ths = window.screen.availHeight;
tws = window.screen.availWidth;
hs = parseInt((ths * height)/100);
ws = parseInt((tws * width)/100);
window.open("intro.html","
}
else {
window.open("intro.html","
}
Keep in mind that I never did get the resizing to work, so I just used the code that I am currently using even though it is not working yet.
Thanks,
Alan
Sorry, been drunk a lot...so..here's some more help
You had a LOT of errors there......see the following WORKING code:
<html>
<head>
<script>
function wopen(w,h)
{
if (parseInt(navigator.appVer
{
ths = window.screen.availHeight;
tws = window.screen.availWidth;
hs = parseInt((ths * h)/100);
ws = parseInt((tws * w)/100);
window.open("intro.html","
}
else
{
window.open("intro.html","
}
}
wopen(40, 40);
</script>
</head>
<body>
</body>
</html>
I don't use books nor ever will use books. It is all about knowledge, learning some language is cool but try to do it on your own, find references on MSDN or somewhere else, but try to be far away of books UNLESS you are just starting out with programming. This counts for all programming languages I am working with.....
Glad to be of service!
Regards,
CJ
Business Accounts
Answer for Membership
by: CJ_SPosted on 2000-11-08 at 10:39:04ID: 5189841
I don't think you can use percentages in it. What you however can do is to calculate the pixels. Done like:
th = window.screen.availHeight;
tw = window.screen.availWidth;
h = parseInt((th * 56)/100); // 56%
w = parseInt((tw * 40)/100); // 40%
window.open("mypage.htm", "", "width="+w+",height="+h);
Regards,
CJ