TravisLaborde
IS-IT--Management
I'm working on a "popup" sort of thing, using SPANs and STYLEs and some client side script, but having what I hope is a small problem. Here is what I'm doing:
1) I have <span id=NormalText>Some Stuff Here</span>
2) I have <span id=PopupText style=display:none> Lots of info in here, maybe an HTML table, a form, buttons, a picture, whatever.. </span>
3) I have client side code: NormalText_OnMouseOver() ...
In that client side code, I turn the visibility ON for the PopupText span.. via: PopupText.style("display" = ""
That's a simplified view of what's going on, and that all works fine... there is also a stylesheet as well which gives the Popup span a z-index, and background color, etc.. so it looks like a "tooltip" sort of thing.
The problem is, I'd like to also position the Popup span to have x and y coordinates near the original NormalText span that caused the event.. like a true tooltip would do.
I've tried reading the .clientX (and Y) and .offsetX (and Y) but they are not working for me for one simple reason...
That original text is in a tablecell... ugh.. So the those properties return a very small number, and when I use that number to set the X and Y of my popup span, it appears up near the top left of the screen instead of over the object that caused the popup.
I need to find the REAL x and y coordinates of that span. Is there any way to do this?
Thanks!
Travis
1) I have <span id=NormalText>Some Stuff Here</span>
2) I have <span id=PopupText style=display:none> Lots of info in here, maybe an HTML table, a form, buttons, a picture, whatever.. </span>
3) I have client side code: NormalText_OnMouseOver() ...
In that client side code, I turn the visibility ON for the PopupText span.. via: PopupText.style("display" = ""
That's a simplified view of what's going on, and that all works fine... there is also a stylesheet as well which gives the Popup span a z-index, and background color, etc.. so it looks like a "tooltip" sort of thing.
The problem is, I'd like to also position the Popup span to have x and y coordinates near the original NormalText span that caused the event.. like a true tooltip would do.
I've tried reading the .clientX (and Y) and .offsetX (and Y) but they are not working for me for one simple reason...
That original text is in a tablecell... ugh.. So the those properties return a very small number, and when I use that number to set the X and Y of my popup span, it appears up near the top left of the screen instead of over the object that caused the popup.
I need to find the REAL x and y coordinates of that span. Is there any way to do this?
Thanks!
Travis