• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Coordinates of a object in javascript...

 
Devesh H Rao
Ranch Hand
Posts: 687
Hibernate jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 687
Hibernate jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic