Handling tooltip events
The Tooltip widget defines three events that allow you to add call back functions to perform different actions, when certain events exposed by the widget are detected. The following table lists the configuration options that are able to accept executable functions on an event:
Event |
Fired when… |
---|---|
|
A tooltip is closed or triggered on |
|
A tooltip is created |
|
A tooltip is shown or triggered on |
Each component of the library has callback options (such as those in the previous table), which are tuned to look for key moments in any visitor interactions. Any functions we use within these callbacks are usually executed before the change happens. Therefore, you can return false
from your callback and prevent the action from occurring.
In our next example, we'll look at how easy it is to react to a particular tooltip being displayed, using the standard non-bind technique. Change the final <script>
element...