Link to home
Create AccountLog in
Avatar of ddepuemd
ddepuemd

asked on

absolute position of a tooltip in an asp.net page

how do you make sure that your display of a tooltip is in a known position on an asp.net page?

after we load the tooltip from a mouse over, we do this:

document.getElementById('ToolTip').innerHTML = "<DIV CLASS='tooltip' ID='ToolTipStyle'>" + str + "</DIV>";
document.getElementById('ToolTipStyle').style.left = 100;
document.getElementById('ToolTipStyle').style.top = 100;
document.getElementById('ToolTipStyle').style.position = 'relative';            
document.getElementById('ToolTip').visibility = 'visible';

but the tooltip still appears on the bottom, no matter what we change the values to.  Is there any better way to do this?
Avatar of Jeeva Subburaj
Jeeva Subburaj
Flag of United States of America image

set the zindex and see how it works..  if zero not works, try with some other values.
document.getElementById(''ToolTip'').style.zIndex = 0
Avatar of ddepuemd
ddepuemd

ASKER

doesn't help.  is there an easier way to make tooltips?  I've read some solutions here that reference a "title" for an element.  Is this supposed to work?  We are using asp.net v 1.1.
Many ASP.NET controls have a tooltip property. You also might try looking at the Hover Menu that's part of the AJAX Toolkit (http://www.asp.net/AJAX/AjaxControlToolkit/Samples/HoverMenu/HoverMenu.aspx) It's meant to be used for menus, but you could just as easily use it as a tooltip since it basically popups on a mouseover.
ASKER CERTIFIED SOLUTION
Avatar of Jeeva Subburaj
Jeeva Subburaj
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account