Methods
-
Initializes a new tab group from the given tab pane collection.
This function cycles through the given tab pane DOM nodes, extracts their tab IDs, titles and active states, renders a corresponding tab menu and prepends it to the tab panes common parent DOM node.
The tab menu labels will be set to the value of the
data-tab-title
attribute of each corresponding pane. The last pane with thedata-tab-active
attribute set totrue
will be selected by default.If no pane is marked as active, the first one will be preselected.
Name Type Description panes
Array.<Node> | NodeList A collection of tab panes to build a tab group menu for. May be a plain array of DOM nodes or a NodeList collection, such as the result of a
querySelectorAll()
call or the.childNodes
property of a DOM node. -
Checks whether the given tab pane node is empty.
Name Type Description pane
Node The tab pane to check.
Returns:
Type Description boolean Returns true
if the pane is empty, elsefalse
.