Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you open a window in a specific size?

Status
Not open for further replies.

sc123

IS-IT--Management
Feb 13, 2002
89
US
Hey all:
Using the code below (which detects Flash player presence), how do I open the flash.html and noflash.html in a specific window size in the same browser window? I just can't figure out the syntax.
Thanks!
-SC


<SCRIPT LANGUAGE=JavaScript1.1>
<!--
var MM_contentVersion = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes[&quot;application/x-shockwave-flash&quot;]) ? navigator.mimeTypes[&quot;application/x-shockwave-flash&quot;].enabledPlugin : 0;
if ( plugin ) {
var words = navigator.plugins[&quot;Shockwave Flash&quot;].description.split(&quot; &quot;);
for (var i = 0; i < words.length; ++i)
{
if (isNaN(parseInt(words)))
continue;
var MM_PluginVersion = words;
}
var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf(&quot;MSIE&quot;)>=0
&& (navigator.appVersion.indexOf(&quot;Win&quot;) != -1)) {
document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
document.write('on error resume next \n');
document.write('MM_FlashCanPlay = ( IsObject(CreateObject(&quot;ShockwaveFlash.ShockwaveFlash.&quot; & MM_contentVersion)))\n');
document.write('</SCR' + 'IPT\> \n');
}
if ( MM_FlashCanPlay ) {
window.location.replace(&quot;flash.html&quot;);
} else{
window.location.replace(&quot;noflash.html&quot;);
}
//-->

</SCRIPT>
 
Not sure if this is what you're after, but you can resize the window using resizeTo(iWidth,iHeight) or resizeBy(iWidth,iHeight) where iWidth and iHeight are integers.

Adam
while(ignorance==true){perpetuate(violence,fear,hatred);life=life-1};
 
adam:
Please forgive my ignorance and do me a favor by providing an example of the code.
Thanks,
SC
 
<body onload=&quot;resizeTo(400,400)&quot; onresize=&quot;resizeTo(400,400)&quot;>


wink,

code one
 
Code:
Thanks man! Worked like a champ!
Sincerely,
SC
 
hey glad it helped,

you know you can also put that code in buttons and stuff..

just some tips to share
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top