YUI recommends YUI3.
YUI 2 has been deprecated since 2011. This site acts as an archive for files and documentation.
This documentation is no longer maintained.
Hover over the orange box and the link to see their Tooltips.
Hover over me to see a Tooltip!
The Tooltip Control is an extension of Overlay that is analogous to popup tooltips within common operating systems. The standard tooltip interaction pattern involves a small overlay that is displayed when the mouse hovers over a context element for a specified amount of time. Tooltip is designed to be simple to implement with easily-accessed configuration options and visual styling handled entirely via CSS.
Tooltips are instantiated by script and are rendered (and hidden) automatically when the window's load
event fires; unlike other controls in the Container family, no call to render
is required with Tooltip. Tooltip introduces several specific configuration properties:
In this tutorial, we'll create two Tooltips. The first will be associated with an element with an id of ctx
, and will have its text set explicitly. The second Tooltip will be associated with a link with an id of link
, but it will retrieve its text from the link's title
attribute:
The corresponding markup for the context elements for this tutorial looks like this:
Note: You are viewing this example in debug mode with logging enabled. This can significantly slow performance.
All YUI 2.x users should review the YUI 2.8.2 security bulletin, which discusses a vulnerability present in YUI 2.4.0-2.8.1.
Copyright © 2013 Yahoo! Inc. All rights reserved.