aspose file tools*
The moose likes JSP and the fly likes How to find the left and top position for a text? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply locked New topic
Author

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

age spets
Ranch Hand

Joined: Aug 07, 2002
Posts: 68
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

Joined: Jan 10, 2002
Posts: 61606
    
  67

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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
age spets
Ranch Hand

Joined: Aug 07, 2002
Posts: 68
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to find the left and top position for a text?