Marianosc
asked on
Resize DIV works in IE but not in FireFox with DOCTYPE - Strict
Ok so all my pages are set to strict as below
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
On the resize of the window I have it running a function
<body onResize="AdjustFlash();">
Here is the functiion which resizes a DIV with a flash object in it. It works only in IE when set to STRICT, but both when the DOCTYPE is removed ... but then other things look funny so this is not an option.
function AdjustFlash() {
var myWidth = 0, myHeight = 0;
if( typeof( window.innerWidth ) == 'number' ) {
//Non-IE
myWidth = window.innerWidth;
myHeight = window.innerHeight;
} else if( document.documentElement &&
( document.documentElement.c lientWidth || document.documentElement.c lientHeigh t ) ) {
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.c lientWidth ;
myHeight = document.documentElement.c lientHeigh t;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight ;
}
myTop=83;
myLeft=200;
myHeight=myHeight-myTop;
myWidth=myWidth-myLeft;
document.getElementById("m yFlash").s tyle.width =myWidth;
document.getElementById("m yFlash").s tyle.heigh t=myHeight ;
//document.getElementById( "myLeftMai nMenu").st yle.height =myHeight;
}
And here is the actual DIV just for reference
<div id="myFlash" style="top:83px; left:200px; width:640px; height:480px; position:absolute">
<script type="text/javascript" language="JavaScript1.2">A djustFlash ();</scrip t>
<object classid="clsid:D27CDB6E-AE 6D-11cf-96 B8-4445535 40000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="100%" height="100%">
<param name="movie" value="images/HomeLabels.s wf">
<param name="quality" value="high">
<param name="wmode" value="transparent">
<embed src="images/HomeLabels.swf " quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockw ave-flash" width="100%" height="100%" wmode="transparent"></embe d>
</object>
</div>
Thanks,
Mariano.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
On the resize of the window I have it running a function
<body onResize="AdjustFlash();">
Here is the functiion which resizes a DIV with a flash object in it. It works only in IE when set to STRICT, but both when the DOCTYPE is removed ... but then other things look funny so this is not an option.
function AdjustFlash() {
var myWidth = 0, myHeight = 0;
if( typeof( window.innerWidth ) == 'number' ) {
//Non-IE
myWidth = window.innerWidth;
myHeight = window.innerHeight;
} else if( document.documentElement &&
( document.documentElement.c
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.c
myHeight = document.documentElement.c
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight
//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight
}
myTop=83;
myLeft=200;
myHeight=myHeight-myTop;
myWidth=myWidth-myLeft;
document.getElementById("m
document.getElementById("m
//document.getElementById(
}
And here is the actual DIV just for reference
<div id="myFlash" style="top:83px; left:200px; width:640px; height:480px; position:absolute">
<script type="text/javascript" language="JavaScript1.2">A
<object classid="clsid:D27CDB6E-AE
<param name="movie" value="images/HomeLabels.s
<param name="quality" value="high">
<param name="wmode" value="transparent">
<embed src="images/HomeLabels.swf
</object>
</div>
Thanks,
Mariano.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER