This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
    Bookmark Topic Watch Topic
  • New Topic

How to find the left and top position for a text?

 
age spets
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi!
The problem is:My menus dropdown list is depending on the browser, screen solution and also if the window is maximized or not.
Will therefore try to find out which position(from left and from top) some text from tables inside my window has, and then just adjust my dropdown list after that. By setting:
style.left &
style.top.
1. Which code do I use to find the left and top position of some text thats already in the page?
This is the text:
<td width="125" align="center"><a href="#" onMouseClick="findLeftAndTopPosition()">***TextToFindPositionFor**</a></td>
yours Age
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64982
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Certainly not a JSP question, so I expect this shold be moved to the HTML forum.
In anticipation of that, why do you want to do such a thing rather than relying on the usual CCS2 positioning mechanisms? What are you really trying to accomplish?
bear
 
age spets
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Report post to moderator
The reason why I posted it here is simply since I am using it in a jsp file. But I will post it under the javascript section... Didnt know it was there..
The reason why I have to solve the problem in this way, is that the css left margin will change depending on the screen size, navigator they use and the maximize/minimize of the window. Therefore I need some javascript to set the left margin depending on other text in the window.
 
    Bookmark Topic Watch Topic
  • New Topic