Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Please help to find a right syntax !

Hi !

Presume there is an image on a DHTML layer. There is a mouse event attached
to that image. But for whatever reason I need to let the script know is this
image on any layer and if so - on what layer exactly. How to do this (cross-browser
scripts welcome). Simply speaking - I need to know the right syntax to reference
to a parent layer object:

document --> (layers) --> (objects on layer)

Thank you !
Ziggi

PS - please - if possible copy the message to priv: ziggizag@poczta.onet.pl
[549 byte] By [Ziggi] at [2007-11-9 16:15:29]
# 1 Re: Please help to find a right syntax !
first give the image an NAME and ID (same content)
for instance:
<DIV ID="parentLyr"><IMG SRC="foobar.gif" NAME="foo" ID="foo"></DIV>

for IE4:
document.all.foo
for NS4:
document.parentLyr.foo
for ns6/ie5+
document.getElementById.foo

if you only want to accsess the image you could also use:
document.images['foo']

in the first set you accsess the image by its ID in the latter by its NAME..
(that's why you should always try and match name/id values)

hope this helps..

patch

Ziggi wrote in message <3d01e106$1@10.1.10.29>...
>
>Hi !
>
>Presume there is an image on a DHTML layer. There is a mouse event attached
>to that image. But for whatever reason I need to let the script know is
this
>image on any layer and if so - on what layer exactly. How to do this
(cross-browser
>scripts welcome). Simply speaking - I need to know the right syntax to
reference
>to a parent layer object:
>
>document --> (layers) --> (objects on layer)
>
>Thank you !
>Ziggi
>
>PS - please - if possible copy the message to priv: ziggizag@poczta.onet.pl
patch at 2007-11-11 23:36:51 >