|
STools | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--STooltip
Version: 1.0
Author: deltapositive (deltapositive@yahoo.fr)
Defined in STooltip.js
Requires:
Field Summary | |
<static> string |
CSS_CLASSNAME
The name of the css classname (for tooltip) used by default when creating tooltips. |
<static> string |
CSS_CLASSNAME_OVER
The name of the css classname (for the element over the tooltip) used by default when creating tooltips. |
<static> int |
POPUP_TIME
This constant determines the time (in ms) tooltips will stay visible on an automatic popup. Default value is 5000 ms. |
<static> int |
WAIT_TIME
This constant determines the time (in ms) tooltips will wait before appearing. Default value is 500 ms. |
Constructor Summary | |
STooltip
()
STooltip is part of the STools. Copyright 2005 STools Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. STooltip is a class that can create a tooltip message (generaly for help purposes). Basic usage: This class is usefull when you want to provide information on an element when the user put his mouse over it. Idem when you do not have enough space to write something, you can show it after a short delay. |
Method Summary | |
void
|
attachToElement(htmlElement)
Attach listeners to the given html element, after the wait time, the tooltip will show. |
void
|
dettachFromElement(htmlElement)
Detach all listeners from the given html element. |
string
|
getContent()
Get the html content of the tooltip. |
int
|
getHeight()
Get the current height setted for the tooltip (not its real). |
int
|
getLeftPosition()
Get the current left coordinate of the tooltip. |
int
|
getTopPosition()
Get the current top coordinate of the tooltip. |
int
|
getWidth()
Get the current width setted for the tooltip (not its real). |
void
|
hide()
Hide the tooltip immediately. Fires the onhide event. |
void
|
setContent(<string> html)
The the html content of the tooltip. |
void
|
setCSSClass(<string> className)
Apply a css class to the tooltip. |
void
|
setCSSClassForOver(<string> className)
Apply a css class to the element over the tooltip. Might be set for shadow purposes. |
void
|
setEventListener(<string> event, <function> listener)
Set a listener for an event. |
void
|
setLevel(<int> level)
Change the z-index of the tooltip. |
void
|
setPopupTime(<int> time)
When the tooltip is popuped up automatically, it will hide after this time. The default value is the STooltip.POPUP_TIME .
|
void
|
setPosition(<int> left, <int> top)
Change the tooltip position. The effect is immediate on a displayed popup. |
void
|
setSize(<int> width, <int> height)
Change the (minimal) tooltip size. The effect is immediate on a displayed tooltip. If the size is bigger than the maximal size, the maximal size will be increased to the size. |
void
|
setWaitTime(<int> time)
Before the tooltip is popuped up automatically, it will wait the wait time. The default value is the STooltip.WAIT_TIME .
|
void
|
show(<boolean> autohide)
Display the tooltip at the last position setted. Fires the onshow event. |
Field Detail |
<static> string CSS_CLASSNAME
<static> string CSS_CLASSNAME_OVER
<static> int POPUP_TIME
<static> int WAIT_TIME
Constructor Detail |
STooltip()
Method Detail |
void attachToElement(htmlElement)
void dettachFromElement(htmlElement)
string getContent()
int getHeight()
int getLeftPosition()
int getTopPosition()
int getWidth()
void hide()
void setContent(<string> html)
html
- The html to show in the tooltip.
void setCSSClass(<string> className)
className
- The name of a css class to apply to the tooltip.
void setCSSClassForOver(<string> className)
className
- The name of a css class to apply to the over element.
void setEventListener(<string> event, <function> listener)
event
- The name of the event to listen among: void function (stooltip)
,void function (stooltip)
,boolean function (stooltip, element)
,listener
- The function to call if corresponding event is fired.
void setLevel(<int> level)
level
- The level to set.
void setPopupTime(<int> time)
STooltip.POPUP_TIME
.time
- The time in ms after which the tooltip will hide, or null to use STooltip.POPUP_TIME
.
void setPosition(<int> left, <int> top)
left
- The new left coordinate.
top
- The new top eft coordinate.
void setSize(<int> width, <int> height)
width
- The width to set.
height
- The height to set.
void setWaitTime(<int> time)
STooltip.WAIT_TIME
.time
- The time in ms after which the tooltip will show, or null to use STooltip.WAIT_TIME
.
void show(<boolean> autohide)
autohide
- When autohide is on, the tooltip will close automatically after the pop time has exceeded. Default value is false.
|
STools | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |