ASP.NET MVC Controls
Tooltip Class
File
wijmo.js
Module
wijmo
Derived Classes
ChartTooltip

Provides a pop-up window that displays additional information about elements on the page.

The Tooltip class can be used in two modes:

Automatic Mode: Use the setTooltip method to connect the Tooltip to one or more elements on the page. The Tooltip will automatically monitor events and display the tooltips when the user performs actions that trigger the tooltip. For example:

var tt = new wijmo.Tooltip();
tt.setTooltip('#menu', 'Select commands.');
tt.setTooltip('#tree', 'Explore the hierarchy.');
tt.setTooltip('#chart', '#idChartTooltip');

Manual Mode: The caller is responsible for showing and hiding the tooltip using the show and hide methods. For example:

var tt = new wijmo.Tooltip();
element.addEventListener('click', function () {
  if (tt.isVisible) {
    tt.hide();
  } else {
    tt.show(element, 'This is an important element!');
  }
});

Constructor

Properties

Methods

Events

Constructor

constructor

constructor(options?: any): Tooltip

Initializes a new instance of the Tooltip class.

Parameters
Returns
Tooltip

Properties

gap

Gets or sets the distance between the tooltip and the target element.

Type
number

hideDelay

Gets or sets the delay, in milliseconds, before hiding the tooltip after the mouse leaves the target element.

Type
number

isContentHtml

Gets or sets a value that determines whether the tooltip contents should be displayed as plain text or as HTML.

Type
boolean

isVisible

Gets whether the tooltip is currently visible.

Type
boolean

showAtMouse

Gets or sets a value that determines whether the tooltip should be positioned with respect to the mouse position rather than the target element.

Type
boolean

showDelay

Gets or sets the delay, in milliseconds, before showing the tooltip after the mouse enters the target element.

Type
number

Methods

dispose

dispose(): void

Removes all tooltips associated with this Tooltip instance.

Returns
void

hide

hide(): void

Hides the tooltip if it is currently visible.

Returns
void

onPopup

onPopup(e: TooltipEventArgs): void

Raises the popup event.

Parameters
Returns
void

setTooltip

setTooltip(element: any, content: string): void

Assigns tooltip content to a given element on the page.

The same tooltip may be used to display information for any number of elements on the page. To remove the tooltip from an element, call setTooltip and specify null for the content.

Parameters
  • element: any

    Element, element ID, or control that the tooltip explains.

  • content: string

    Tooltip content or ID of the element that contains the tooltip content.

Returns
void

show

show(element: any, content: string, bounds?: Rect): void

Shows the tooltip with the specified content, next to the specified element.

Parameters
  • element: any

    Element, element ID, or control that the tooltip explains.

  • content: string

    Tooltip content or ID of the element that contains the tooltip content.

  • bounds: Rect Optional

    Optional element that defines the bounds of the area that the tooltip targets. If not provided, the bounds of the element are used (as reported by the getBoundingClientRect method).

Returns
void

Events

 

 


Copyright © GrapeCity, inc. All rights reserved.

Product Support Forum |  Documentation Feedback