new Tabs(element, options)
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
element |
HTMLElement | DOM element for component instantiation and scope |
||||||||||||||||||||||||||||||
options |
Object |
Properties
|
Classes
Members
onToggle
Sets the callback function to be executed on toggle.
onToggle
Gets the callback function set for toggle events.
Methods
arrowFocusToTab(currentTab, direction)
Parameters:
Name | Type | Description |
---|---|---|
currentTab |
HTMLElement | tab element |
direction |
string | key arrow direction |
closeMoreDropdown(e)
Parameters:
Name | Type | Description |
---|---|---|
e |
Event |
destroy()
handleClickOnToggle()
handleKeyboardOnTabs(e)
Parameters:
Name | Type | Description |
---|---|---|
e |
Event |
handleResize()
init()
moveFocus(currentTab)
Parameters:
Name | Type | Description |
---|---|---|
currentTab |
HTMLElement | tab element |
on(eventName, callback) → {void}
Example
// Registering a callback for the 'onToggle' event
inpage.on('onToggle', (event) => {
console.log('Toggle event occurred!', event);
});
Parameters:
Name | Type | Description |
---|---|---|
eventName |
string | The name of the event to listen for. |
callback |
function | The callback function to be invoked when the event occurs. |
Returns:
- Type
- void
shiftTabs(dir)
Parameters:
Name | Type | Description |
---|---|---|
dir |
int | string |
tabsKeyEvents()
trigger(eventName, eventData)
Parameters:
Name | Type | Description |
---|---|---|
eventName |
string | The name of the event to trigger. |
eventData |
any | Data associated with the event. |
(static) autoInit(root) → {Tabs}
Parameters:
Name | Type | Description |
---|---|---|
root |
HTMLElement | DOM element for component instantiation and scope |
Returns:
An instance of Tabs.
- Type
- Tabs