Search
Tooltip Constructor
See Also
 






Initializes a new instance of the Tooltip class.

Namespace: MindFusion.Common.UI
File: Tooltip.js

 Syntax

JavaScript  Copy Code

function Tooltip (target, [title])

 Parameters

target

HTMLElement. The HTML element that will trigger the tooltip.

title
Optional.

String. The display text of the tooltip.

 Example

The following example uses the handler of an itemDoubleClick event to create a tooltip for the clicked item:

JavaScript  Copy Code

function handleItemDoubleClick(sender, args)
{
 if (args.item.data)
 {
  var tip = new ui.Tooltip(args.item.element);

  var t = document.createElement("div");
  var img = document.createElement("img");
  img.width = img.height = "40";
  img.src = "icon_fish.png";
  img.style.verticalAlign = "middle";
  t.appendChild(img);
  var span = document.createElement("span");
  span.innerText = "This user is not currently online";
  t.appendChild(span);
  tip.template = t.outerHTML;
 }
}

 See Also