Resize DIV works in IE but not in FireFox with DOCTYPE - Strict

Posted on 2004-11-30
Last Modified: 2013-11-19
Ok so all my pages are set to strict as below

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=",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="" type="application/x-shockwave-flash" width="100%" height="100%" wmode="transparent"></embed>


Question by:Marianosc
    LVL 25

    Accepted Solution


    Author Comment

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Javascript: Crash Course

    Javascript is not only emerging as the most important language to know, it's flexibility is unique. With Javascript being deployed on the web, mobile and even the desktop this is the one language that all technologists need to know.

    Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
    Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
    HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
    This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now