Richard wrote:
In considering the various possible methods of doing my photo gallery, I
have run across this little diddy.
What is meant by "element"?
An element is essentially the stuff from the start to the end of an
HTML tag or pair of tags.
<p> ... </p>
is a paragraph or "p" element. Some elements have no end tag:
<img ... >
When mouse is moved over "element" at x,y, is that "element" the entire
image or something else?
The entire element. Take care, many elements can (and do) have
children e.g. tables.
My thought would be to simply retrieve the thumbnail name or other ID and
use that to identify which large image to show.
Any reasons why NOT to use this property?
It is a Microsoft extension, probably only implemented in IE (it
doesn't work in Firefox or Mozilla) and infrequently used. Therefore
leave it well alone.
If you are building a photo gallery, you likely want to use a plain old
<a href=... > that requires no JavaScript at all. If you want to show
your images in a new window or frame, add an onclick that does so but
make the href point to the image so that if JavaScript is not enabled
in the users browser, the image will still be displayed.
Your thumbnail element could look like:
<a href="pic01.jpg" onclick="showImg(this.href);return false" ...
... ><img src="th_pic01" ... ></a>
Then add a function showImg(imgRef) to show the bigger image. If JS is
disabled, the page will just show "pic01.jpg".
--
Rob