473,413 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

any good examples of usage of document.elementfrompoint ?

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?

Jul 23 '05 #1
2 2583
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
Jul 23 '05 #2

"RobG" <rg***@iinet.net.auau> wrote in message
news:41**********************@per-qv1-newsreader-01.iinet.net.au...
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".

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.
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Daniel Ehrenberg | last post by:
I'm trying to learn wxPython, but I can't seem to find much documentation. The wxPython website says that all advanced (and even some basic) documentation for wxPython is only available in C++...
18
by: Dan Cernat | last post by:
Hi there, A few threads I had a little chat about default values. I am starting this thread because I want to hear more opinions about the default values of function parameters. Some say they...
4
by: Darren | last post by:
Hi. I have a javascript menu system which uses the "elementFromPoint" function. However Netscape/Mozilla doesn't recognise this function. Does it have an equivilent? Thanks -- Darren
102
by: Xah Lee | last post by:
i had the pleasure to read the PHP's manual today. http://www.php.net/manual/en/ although Pretty Home Page is another criminal hack of the unix lineage, but if we are here to judge the quality...
48
by: Tony | last post by:
How much bloat does the STL produce? Is it a good design wrt code bloat? Do implementations vary much? Tony
206
by: WaterWalk | last post by:
I've just read an article "Building Robust System" by Gerald Jay Sussman. The article is here: http://swiss.csail.mit.edu/classes/symbolic/spring07/readings/robust-systems.pdf In it there is a...
3
by: goodsanthosh | last post by:
I used the elementFromPoint method and it works porperly in a page. when i set this page as a source of a frameset frame. it cannot work . it will return another element. How can i solve this...
1
by: ShadowLocke | last post by:
This is an HTML application that allows you to monitor the CPU Usage (as seen in task manager) for any one task either on the local computer or a remote computer using vbscript. It then alerts you...
0
by: WebCM | last post by:
I hope you can spend some time and help me to select proper application design and programming issues. :) I'm making new version of CMS. I've been mostly theorizing about it for a recent months. ...
76
by: lorlarz | last post by:
Crockford's JavaScript, The Good Parts (a book review). This shall perhaps be the world's shortest book review (for one of the world's shortests books). I like Douglas Crockford (because I am a...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.