any good examples of usage of document.elementfrompoint ?

R

Richard

In considering the various possible methods of doing my photo gallery, I
have run across this little diddy.

What is meant by "element"?

When mouse is moved over "element" at x,y, is that "element" the entire
image or something else?
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?
 
R

RobG

Richard said:
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:

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".
 
R

Richard

RobG said:
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:



The entire element. Take care, many elements can (and do) have
children e.g. tables.


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".


I basically undestand that much. I do not want a new window.
I want the large image retained on the same page in the adjoining division.

http://somestuff.batcave.net/demo2.htm

The right column top portion would show a description, while the bottom
portion would show the larger image.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top