• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 633
  • Last Modified:

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' ) {
    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;

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>


1 Solution
MarianoscAuthor Commented:
Cool that worked. Thanks ... now should I give you the points or COBOLdinosaur??? ;)

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now