Dr said:
The next wish is to be able to alter the position and size of another
image, by executing script. Either IE4 cannot do that, or I'm missing a
necessary piece in the code :
with (document.images["SH"]) { alert(height) } // alert shows number
but
with (document.images["SH"]) { height = 10 + T1*5 } // no effect
REPLACE the implied question; it appears that the script will change the
size, but not if it was defined in HTML/CSS. Alas, width cannot be
negative. Far worse, though, I've not yet seen how to move the image by
javascript; I need to set left and top too.
While working with IE, Microsoft site can be very usefull ;-)
In the particular
<
http://msdn.microsoft.com/library/d...author/dhtml/reference/properties/width_1.asp>
states that:
<quote>
When scripting the height property, use either the pixelHeight or
posHeight property to numerically manipulate the height value.
If dynamic changes are intended for the height and width, the original
values should be set through style (e.g. "style=''height:200px;
width:200px'') rather than through the height and width attributes.
</quote>
pixelWidth and pixelHeight are stated in the article to be supported
since IE 4.0 but I personally do not recall anyone managed to use it
until the very end of the war (IE 5.x) Nevertheless this article
contains a working example. If you see "Show me" button on the page,
that means that your version of IE considered to be able to perform.
Otherwise the button will not be visible.
imageObject.width and imageObject.height have been left as read/write
properties for legacy issue. First indroduced in Netscape 3.0 Gold
milestone, Image object was originally planned to have scriptable width
and height propetry. Not too many people remember that the full syntacs
for Image is:
var myImage = new Image(widthInPixel, heightInPixel);
Latter Netscape run into problems to provide such interface (on fixed
layout with DOM 0 Level it was indeed too much). But since any browser
*has* to support everything Netscape Gold had, width and height has
been left as blackhole interfaces. You can read them, but they very
rarely contain any valuable information. You can write to them, but it
has no effect on the object layout.