Working with the Tab events
The Tabs widget defines a series of useful options that allow you to add callback 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 new tab is added. |
|
A tab is disabled. |
|
A tab is enabled. |
|
A tab's remote data has loaded. |
|
A tab is removed. |
|
A tab is selected. |
|
A tab is shown. |
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 will look at how easy it is to react to a particular tab being selected, using the standard...