Except as otherwise noted,
the content of this page is licensed under the Creative Commons
Attribution 2.5 License.
A class gadgets can use to make tabs.
gadgets.TabSet(opt_moduleId, opt_defaultTab, opt_container)
String
addTab(tabName, opt_params)
alignTabs(align, opt_offset)
displayTabs(display)
Element
getHeaderContainer()
gadgets.Tab
getSelectedTab()
Array.<gadgets.Tab>
getTabs()
removeTab(tabIndex)
setSelectedTab(tabIndex)
swapTabs(tabIndex1, tabIndex2)
gadgets.TabSet(opt_moduleId, opt_defaultTab, opt_container)
String opt_moduleId - Optional suffix for the ID of tab container.
String opt_defaultTab - Optional tab name that specifies the name of
of the tab that is selected after initialization.
If this parameter is omitted, the first tab is selected by
default.
Element opt_container - The HTML element to contain the tabs. If
omitted, a new div element is created and inserted at the
very top.
String addTab(tabName, opt_params)
String tabName - Label of the tab to create.
Object opt_params - Optional parameter object. The following
properties are supported:
.contentContainer An existing HTML element to be used as
the tab content container. If omitted, the tabs
library creates one.
.callback A callback function to be executed when the tab
is selected.
.tooltip A tooltip description that pops up when user moves
the mouse cursor over the tab.
.index The index at which to insert the tab. If omitted,
the new tab is appended to the end.
String DOM id of the tab container.
alignTabs(align, opt_offset)
String align - 'left', 'center', or 'right'.
Number opt_offset - Optional parameter to set the number of pixels
to offset tabs from the left or right edge. The default
value is 3px.
displayTabs(display)
Boolean display - true to show tabs; false to hide tabs.
Element getHeaderContainer()
Element The tab headers container element.
gadgets.Tab getSelectedTab()
gadgets.Tab The currently selected tab object.
Array.<gadgets.Tab> getTabs()
Array.<gadgets.Tab> Array of all existing tab objects.
removeTab(tabIndex)
Number tabIndex - Index of the tab to remove.
setSelectedTab(tabIndex)
Number tabIndex - Index of the tab to select.
swapTabs(tabIndex1, tabIndex2)
Number tabIndex1 - Index of the first tab to swap.
Number tabIndex2 - Index of the secnod tab to swap.