[Javascript] IE & NN dom references

Steve White steve at VirtualMechanics.com
Thu Mar 22 07:40:55 CST 2001


This method works in IE but I am still having some trouble with NN.
Specifically I cannot seem to assign a new value to the width of the image.
The format I am using is:

<div id="OObj3" STYLE="...stuff..">
<img id="GGeo4" SRC="Geo4.png" alt="" width=100 height=100>
</div>

else if(document.layers) {
 ob[2].style = document.layers['OObj3'];
 ob[2].geom = document.layers['OObj3'].document.images['GGeo4'];
}

ob[2].geom.width  = newWidth;

I assume the problem is that "ob[2].geom.width" is not the correct way to
access the width in NN.

Thanks

Steve White
www.VirtualMechanics.com
www.SVGMagic.com

-----Original Message-----
From: javascript-admin at LaTech.edu [mailto:javascript-admin at LaTech.edu]On
Behalf Of Peter-Paul Koch
Sent: Thursday, March 22, 2001 6:15 AM
To: javascript at LaTech.edu
Subject: Re: [Javascript] IE & NN dom references





>I want store references to DIV and IMG elements in a common array so that I
>don't have to worry if it came from NN4.x or IE. If I have a DIV like this:
>
><div id="OObj2" STYLE="...stuff...">
><img id="GGeo2" SRC="Geo2.png" alt="something" width=643 height=165>
></div>

if (document.getElementById) // NN6, IE5, Opera 5
{
   ob[1].style = document.getElementById('OObj2').style;
   ob[1].geom = document.getElementById('GGeo2');
}
else if (document.all) // IE4
{
   ob[1].style = document.all['OObj2'].style;
   ob[1].geom = document.all['GGeo2'];
}
else if (document.layers) // NN4
{
  ob[1].style = document.layers['OObj2'];
  ob[1].geom = document.layers['OObj2'].document.images['GGeo2'];
}

ppk

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
http://www.LaTech.edu/mailman/listinfo/javascript





More information about the Javascript mailing list