STools

Class STooltip

Object
   |
   +--STooltip

class 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

CSS_CLASSNAME

<static> string CSS_CLASSNAME

CSS_CLASSNAME_OVER

<static> string CSS_CLASSNAME_OVER

POPUP_TIME

<static> int POPUP_TIME

WAIT_TIME

<static> int WAIT_TIME

Constructor Detail

STooltip

STooltip()

Method Detail

attachToElement

void attachToElement(htmlElement)

dettachFromElement

void dettachFromElement(htmlElement)

getContent

string getContent()

getHeight

int getHeight()

getLeftPosition

int getLeftPosition()

getTopPosition

int getTopPosition()

getWidth

int getWidth()

hide

void hide()

setContent

void setContent(<string> html)

setCSSClass

void setCSSClass(<string> className)

setCSSClassForOver

void setCSSClassForOver(<string> className)

setEventListener

void setEventListener(<string> event, <function> listener)