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
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply 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: 684

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: 1028
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: 684

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: 15003
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: 15003
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 ]
 
IntelliJ Java IDE
 
subject: Coordinates of a object in javascript...
 
Threads others viewed
Reading Elements from an ArrayList, 3 at a time
Offsetting X/Y
AffineTransform - please help me out
drawing using real world coordinates
Applet ???? help
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture