New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

RadToolTip Object

The following table lists the most important members of the client-side RadToolTip object:

RadToolTip

Public Properties

NameDescription
get_animationGets animation value for the tooltip. Returns an object of type Telerik.Web.UI.ToolTipAnimation .
get_animationDurationGets animation duration value for the tooltip in milliseconds.
get_autoCloseDelayGets delay in milliseconds for the tooltip to close automatically
get_contentGets the current content of the tooltip
get_contentElementGets the content element of the tooltip. See Example 1.
get_contentScrollingGets a new overflow value for the tooltip content area. Returns an object of type Telerik.Web.UI.ToolTipScrolling
get_enableShadowGets a value indicating whether the tooltip should have a shadow.
get_heightGets height of the tooltip
get_hideDelayGets the delay in milliseconds before the tooltip is hidden.
get_ignoreAltAttributeGets a value indicating whether the Alt attribute of the target should be ignored.
get_modalGets whether the tooltip is modal.
get_manualCloseGets whether the tooltip requires to be hidden manually by the user, or hides automatically
get_mouseTrailingGets whether the tooltip should follows the mouse movement or not
get_offsetXGets the horizontal offset relative to its target element
get_offsetYGets the vertical offset relative to its target element
get_overlayGets a value indicating whether the tooltip has an overlay element.
get_popupElementReturns a reference to the DOM object of the popup element.
get_positionGets the relative position to the tooltip to its target element. Returns an object of type Telerik.Web.UI.ToolTipPosition.
get_relativeToGets whether the tooltip is positioned relative to the mouse or relative to the tooltip. Returns an object of type Telerik.Web.UI.ToolTipRelativeDisplay .
get_showCalloutGets whether the tooltip callout image will be displayed
get_showDelayGets delay in milliseconds for the tooltip to appear
get_stickyGets whether the tooltip is hidden when the mouse leaves the target control, or the tooltip itself
get_targetControlGets a reference to the tooltip target element
get_targetControlIDGets the target control of the tooltip
get_textGets the text of the tooltip. See Example 2.
get_titleGets the title of the tooltip
get_widthGets width of the tooltip
set_animationSets animation value for the tooltip. Requires a parameter of type Telerik.Web.UI.ToolTipAnimation . The possible values of this enumerator are None , Resize , Fade , Slide , FlyIn . For example: radToolTip.set_animation(Telerik.Web.UI.ToolTipAnimation.None);.
set_animationDurationSets animation duration value for the tooltip in milliseconds.
set_autoCloseDelaySets delay in milliseconds for the tooltip to close automatically. See Example 3.
set_contentSets new content to the tooltip
set_contentElementSets a new content element to the tooltip
set_contentScrollingSets a new overflow value for the tooltip content area. Requires a parameter of type Telerik.Web.UI.ToolTipScrolling . The possible values are Auto , None , X , Y , Both , Default. For example: radToolTip.set_contentScrolling(Telerik.Web.UI.ToolTipScrolling.None);.
set_enableShadowSets a value indicating whether the tooltip should have a shadow.
set_heightSets new height to the tooltip
set_hideDelaySets the delay in milliseconds before the tooltip is hidden.
set_hideEventSets on what event the tooltip should hide (see Example 4). The HideEvent property is an enum and can take the following values, which names describe the effect when they are set: Default, FromCode, LeaveTargetAndToolTip, LeaveToolTip, ManualClose.
set_ignoreAltAttributeSets a value indicating whether the Alt attribute of the target should be ignored.
set_modalSets whether the tooltip is displayed modally.
set_mouseTrailingSets whether the tooltip should follows the mouse movement or not
set_offsetXSets a new horizontal offset relative to its target element
set_offsetYSets a new vertical offset relative to its target element
set_overlaySets a value indicating whether the tooltip will create an overlay element.
set_positionSets a new relative position to the tooltip according to its target element. Requires an object of type Telerik.Web.UI.ToolTipPosition as a parameter. The possible values are TopLeft , TopCenter , TopRight , MiddleLeft , Center , MiddleRight , BottomLeft , BottomCenter , BottomRight . For example: radToolTip.set_position(Telerik.Web.UI.ToolTipPosition.BottomRight);.
set_relativeToSets whether the tooltip is positioned relative to the mouse or relative to the tooltip. Requires a parameter of type Telerik.Web.UI.ToolTipRelativeDisplay . Its possible values are Mouse , Element , BrowserWindow . For example: radToolTip.set_position(Telerik.Web.UI.ToolTipRelativeDisplay.Element);.
set_showCalloutSets whether the tooltip callout image will be displayed
set_showDelaySets delay in milliseconds for the tooltip to appear. See Example 5.
set_showEventSets on what event the tooltip should show (see Example 6). The ShowEvent property is an enum and can take the following values, which names describe the effect when they are set: OnMouseOver, OnClick, OnRightClick, OnFocus, FromCode.
set_targetControlSets a new target control to the tooltip. When showing a tooltip after changing its target on the client a small timeout is needed. See Example 7.
set_targetControlIDSets a new target control to the tooltip. When showing a tooltip after changing its target on the client a small timeout is needed. See Example 8.
set_textSets new text to the tooltip. See Example 9.
set_titleSets a new title to the tooltip. See Example 10.
set_widthSets new width to the tooltip

Example 1: Get the content element of a tooltip so you can access all checkboxes inside.

JavaScript
var tooltip = $find("RadToolTip3");
var contentElement = tooltip.get_contentElement();
var checkboxes = contentElement.getElementsByTagName("INPUT");

Example 2: Get a tooltip text.

JavaScript
var radToolTip = $find("<%= RadToolTip1.ClientID %>");
alert(radToolTip.get_text());

Example 3: Set the time after which a tooltip will close automatically.

JavaScript
var radToolTip = $find("<%= RadToolTip1.ClientID %>"); // set the auto close delay to 5 seconds 
secondsradToolTip.set_autoCloseDelay(5000);

Example 4: Set the user action that will close a tooltip.

JavaScript
var radToolTip = $find("<%= RadToolTip1.ClientID %>");
radToolTip.set_hideEvent(Telerik.Web.UI.ToolTipHideEvent.ManualClose);

Example 5: Set the time that will pass before the user action that shows the tooltip and the actual tooltip showing.

JavaScript
var radToolTip = $find("<%= RadToolTip1.ClientID %>"); // set the show delay to 2 seconds
secondsradToolTip.set_showDelay(2000);

Example 6: Set the user action that will show the tooltip

JavaScript
var radToolTip = $find("<%= RadToolTip1.ClientID %>");
radToolTip.set_showEvent(Telerik.Web.UI.ToolTipShowEvent.FromCode); //will be shown only via an API call

Example 7: Showing a tooltip after a new target has been set.

JavaScript
var radToolTip = $find("<%= RadToolTip1.ClientID %>");
radToolTip.set_targetControl(txtBoxReference);
setTimeout(function ()
{
	radToolTip.show();
}, 20);

Example 8: Showing a tooltip after a new target has been set.

JavaScript
var radToolTip = $find("<%= RadToolTip1.ClientID %>");
radToolTip.set_targetControlID("Button1");
setTimeout(function () {
	radToolTip.show();
}, 20);

Example 9: Setting new text in a tooltip.

JavaScript
var radToolTip = $find("<%= RadToolTip1.ClientID %>");
radToolTip.set_text("This is the new tool tip text to display");

Example 10: Setting a new title to a tooltip.

JavaScript
var radToolTip = $find("<%= RadToolTip1.ClientID %>");
radToolTip.set_title("This is the new title");

Public Methods

NameDescription
cloneCreates a clone of the tooltip for another targetElement, and possibly with a different text to display.
getManualCloseButtonReturns a reference to the DOM object of the tooltip's close button when HideEvent="ManualClose".
hideHides the tooltip. See Example 11.
isVisibleReturns whether the tooltip control is currently visible. See Example 12.
isModalReturns whether the tooltip control is displaying modally.
showDisplays the tooltip at the proper position, relative to its target control. See Example 13. If the target of the tooltip has been changed with JavaScript, a small timeout is needed prior to calling show() (see Example 14).
showLoadingMessageDisplays the loading message.
updateLocationCalculates the tooltip position according to its targets and repositions the tooltip accordingly.

For a live demo see Client Side API.

Example 11: Hiding a tooltip.

JavaScript
var radToolTip = $find("<%= RadToolTip1.ClientID %>");
if (radToolTip.isVisible())
{
	radToolTip.hide();
}

Example 12: Showing a tooltip with a new text.

JavaScript
var radToolTip = $find("<%= RadToolTip1.ClientID %>");
radToolTip.set_text("This is the new tool tip text to display");
if (!radToolTip.isVisible())
{
    radToolTip.show();
}

Example 13: Show a tooltip.

JavaScript
var radToolTip = $find("<%= RadToolTip1.ClientID %>");
radToolTip.set_text("This is the new tool tip text to display");
radToolTip.show();

Example 14: Show a tooltip after its target has been changed.

JavaScript
var radToolTip = $find("<%= RadToolTip1.ClientID %>");
radToolTip.set_targetControlID("Button1");
setTimeout(function () {
	radToolTip.show();
}, 20);

RadToolTip's static methods

NameDescription
getCurrentGets a reference to the tooltip element that is currently open. See Example 15.

Example 15: Getting the currently shown tooltip, if any.

JavaScript
var activeToolTip = Telerik.Web.UI.RadToolTip.getCurrent();

See Also

In this article
RadToolTipSee Also
Not finding the help you need?
Contact Support