Tooltip
Article Metadata
Contents |
Inheritance
Nokia.Tooltip
| - Nokia.Widget
|- Nokia.Class (basic class)
1 - Description
A tooltip is a small text label with a solid or semi-transparent colour background and a border that floats above other content. The tooltip should be anchored by the content. The tooltip component is automatically sized to fit the tooltip text.
2 - Visual Design
3 - Component Dependencies
3.1 CSS
<!-- Themeroller CSS --> <link rel="stylesheet" href="themes/themeroller/<theme>/Themeroller.css" type="text/css" media="screen"> <!-- Specific Theme/Resolution CSS --> <link rel="stylesheet" href="/themes/nokia/ext-theme/<theme>/<resolution>/custom.css" type="text/css" media="screen">
3.2 Javascript
<!-- jQuery file --> <script src="/lib/jquery/jQuery.js" type="text/javascript" charset="utf-8"></script> <!-- Guarana file --> <script src="/lib/Guarana.js" type="text/javascript" charset="utf-8"></script>
4 - Functional Specifications/Requirements
4.1 - Options
- element: 'selector'
- jQuery selector or the DOM reference to become the container of the component.
- description: string
- Description content to be included in the component.
- zIndex: boolean,
- Defines the zIndex tooltip property, the order in which tooltips will appear in case of overlap.
- disabled: boolean
- Defines whether the component is in disabled mode.
- roundedCorners: boolean
- Defines whether the component has rounded corners.
- around: boolean
- Defines component internal control.
- offset: int
- Defines the offset used by the component.
- direction: String
- Defines the direction that the component will appear in.
- timeout: int
- Defines the timeout to hide the component.
- startVisible: boolean
- Defines whether the component is created in show mode.
- height: int
- Defines the component height.
- width: int
- Defines the component width.
4.2 - Events - Callbacks
- create: function()
- Scope: [this.element]
- show: function(event)
- Scope: [this.element]
4.3 - Methods
- show: function(event, tooltip)
- Shows the tooltip.
- return [void]
- hide: function()
- Hides the tooltip.
- return [void]
4.4 - Default options
- description: ' - ',
- timeout: 3000,
- offset: [0, -15],
- roundedCorners: true,
- zIndex: false,
- direction: 'above center'
5 - Component Demo
5.1 HTML
<a href="#" id="tooltip1">Click Here</a>
5.2 Javascript
var tooltip1 = new Nokia.Tooltip({
element: '#container',
description: 'Click here',
create: function() {
console.log("Tooltip: create.");
}
});
6 - Nokia WRT Browser Compatibility
| ▴ | S60 3.1 | S60 3.2 | S60 5.0 |
| Tooltip | YES | YES | YES |


