This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Coordinates of a object in javascript... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Coordinates of a object in javascript..." Watch "Coordinates of a object in javascript..." New topic
Author

Coordinates of a object in javascript...

Devesh H Rao
Ranch Hand

Joined: Feb 09, 2002
Posts: 687

Hi ppl,
is it possible to find out if a object like select or a text box is present at a given coordinate.
say for eg i have the mouse on (x,y) coordinate as(300,300) is it possible for me to know what object lies at that coordinates.
thanx for any help in advance
Chris Baron
Ranch Hand

Joined: Mar 21, 2003
Posts: 1049
Hi Devesh,
you could use an image-map

this also works with a transparent pixelsize Pic positioned absolutely over your objects
hth
Devesh H Rao
Ranch Hand

Joined: Feb 09, 2002
Posts: 687

Thanx christian for the answer but that is not what i was looking for i think i will give a example to the exact problem that i am facing.
In our application i have a menu which unfolds and goes to n levels which is dynamically decided from the no of nodes a user has access to in the database.
The problem in the page(it is a frame consisting of 3 framesets the top frame contains the menu, the middle frame the body and the third frame is the footer which contains the processing info) is when ever the menu unfolds over a select box the select box peeks thru the menu due to which the menu is not visible properly.
i have deployed a crude method in which i hide all the select objects in the page on opening the menu and the again make them visible when the menu collapses.I wanted to hide only the sepecific select box as an when it hinders the display of the menu hence my requirement for finding a object at a particular coordinate on the page.
Thanx for the help.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
There is a way to do it, I just got home from a trip, so I need to get some stuff done. If is done by referencceing the element object...
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Look at this, I only used the coordinates on the blue div box.
http://www10.brinkster.com/a1ien51/JavaRanch/ElementTest.htm
If you need more help understanding what i did, say so, and I will help.
eric
[ May 19, 2003: Message edited by: Eric Pascarello ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Coordinates of a object in javascript...
 
Similar Threads
drawing using real world coordinates
Reading Elements from an ArrayList, 3 at a time
AffineTransform - please help me out
Applet ???? help
Offsetting X/Y