PDA

Click to See Complete Forum and Search --> : JavaScript Question


wienerdog
11-03-2006, 09:13 PM
Excuse the noobie-ness of this question, but is there a way I can get a page to resize the browser to a specific size with JavaScript?

JPnyc
11-04-2006, 03:13 PM
In some browsers, yes. It'll work in IE and firefox (probably netscrape too) but I don't believe it will in Opera or maxthon or avant.

http://www.devguru.com/Technologies/ecmaScript/quickref/win_open.html

wienerdog
11-06-2006, 12:58 PM
I have a Flash movie placed in an HTML file that I want to open in a browser window that resizes to about the size of the movie.

I tried the following, but the window was too small:
onLoad="javascript: self.window.resizeTo(x.y);"

Do I need to add space for the browser buttons, etc? I have a Flash movie that's 695 px x 195 px and want to resize the browser window to leave a little space below, maybe 30 px.

I'm beginning to think it would be easier to just remove the browser buttons, scroll bar, etc. but can't figure out how?

Andi Creffield
11-06-2006, 01:02 PM
http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_20772577.html

Try this it may help.

You'll have to register to see solutions.

wienerdog
11-06-2006, 01:17 PM
Below is my code, which opens in IE 6 with only the buttons bar showing and opens in a default window size in FireFox. I must have done something wrong.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
</head>

<body onload="javascript: self.window.resizeTo(720.230);">
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','width','695','heigh t','195','title','Movie','src','flash/intro','quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','flash/intro' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="695" height="195" title="Movie">
<param name="movie" value="flash/intro.swf" />
<param name="quality" value="high" />
<embed src="flash/intro.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="695" height="195"></embed>
</object></noscript>
</body>
</html>