Link to home
Start Free TrialLog in
Avatar of Marianosc
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.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } 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("myFlash").style.width=myWidth;
      document.getElementById("myFlash").style.height=myHeight;
      //document.getElementById("myLeftMainMenu").style.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">AdjustFlash();</script>
      <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 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.swf">
        <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-shockwave-flash" width="100%" height="100%" wmode="transparent"></embed>
      </object>
</div>

Thanks,

Mariano.
ASKER CERTIFIED SOLUTION
Avatar of archrajan
archrajan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Marianosc
Marianosc

ASKER

Cool that worked. Thanks ... now should I give you the points or COBOLdinosaur??? ;)