I'm currently having a problem using the RadToolTip (not the manager). When I create my tooltip on the server, I assign the 'OnClientBeforeShow' property to a client side function. This function will then call the 'set_Position()' function of the client-side API.
However, there seems to be some problem with doing this here... The only way the client-side code has any effect on the tooltip position is if I apply an animation to it. However, I would like to show the tooltip w/o animation. Example:
If I put a 'fade' animation on the tooltip, the tooltip will show (fading in), center itself, then go to the bottom-right position. This appears very jumpy. It seems like the 'fade' animation also does not take into account the default position set on the server-side. It seems like the position is set after a lot of other things have taken place.
Thanks
Here is the server and client side code:
Server-side code:
However, there seems to be some problem with doing this here... The only way the client-side code has any effect on the tooltip position is if I apply an animation to it. However, I would like to show the tooltip w/o animation. Example:
If I put a 'fade' animation on the tooltip, the tooltip will show (fading in), center itself, then go to the bottom-right position. This appears very jumpy. It seems like the 'fade' animation also does not take into account the default position set on the server-side. It seems like the position is set after a lot of other things have taken place.
Thanks
Here is the server and client side code:
Server-side code:
Me.EnableEmbeddedSkins = False |
Me.Animation = Telerik.Web.UI.ToolTipAnimation.None |
Me.ContentScrolling = Telerik.Web.UI.ToolTipScrolling.None |
Me.HideDelay = 5000 |
Me.Position = Telerik.Web.UI.ToolTipPosition.BottomRight |
Me.RelativeTo = Telerik.Web.UI.ToolTipRelativeDisplay.Element |
Me.ShowDelay = 350 |
Me.ShowCallout = False |
Me.Sticky = True |
Me.HideEvent = Telerik.Web.UI.ToolTipHideEvent.LeaveToolTip |
Me.OnClientBeforeShow = "Tooltip_OnBeforeShow" |
Client-side: |
function Tooltip_OnBeforeShow(sender, eventArgs) { |
var intPosition, intWidth, intHeight; |
intHeight = document.body.offsetHeight; |
intWidth = document.body.offsetWidth; |
if (sender._mouseY <= (intHeight / 3)) |
{ |
intPosition = 30; |
} |
else if ((sender._mouseY <= (intHeight / 3) * 2)) |
{ |
intPosition = 20; |
} |
else if ((sender._mouseY > (intHeight / 3) * 2)) |
{ |
intPosition = 10; |
} |
if (sender._mouseX <= (intWidth / 2)) |
{ |
intPosition += 3; |
} |
else if (sender._mouseX > (intWidth / 2)) |
{ |
intPosition += 1; |
} |
sender.set_position(intPosition); |
} |