Display tabbed content
All samples are using
Ink.requireModules, please read how to use it at Ink.requireModules section
The Tabs Component offers a simple way to build a tab-separated layout, allowing you to offer multiple content panes in the same space with intuitive navigation. This component requires your markup to have:
tabs-navclass, to contain links.
idattributes and the
When the user clicks in the links inside
tabs-nav, the tab with the corresponding ID is then activated. The active tab when the tab component is initialized has its hash in the browser URL. If there is no hash, then the
active option kicks in. Otherwise, Tabs will fall back to showing the tab corresponding to the first link.
You can disable some (or all) tabs by passing an array for the
disabled option, or by adding the
ink-disabled class to tab links.
|new Tabs(selector, [options])||Constructor|
|.activeContentTab()||Gets the currently active section|
|.activeMenuLink()||Gets the currently active Menu link (the links which the user clicks on to change tabs)|
|.activeTab()||Returns the active tab id|
|.changeTab(selector)||Changes the active tab|
|.destroy()||Unregisters the component and removes its markup|
|.disable(selector)||Disables the desired tab|
|.enable(selector)||Enables the desired tab|
selectorYour container element. You can pass in a pure DOM element or a selector.
optionsOptions object, containing:
options.preventUrlChangefalseFlag that determines if follows the link on click or stops the event
options.activeID of the tab to activate on creation if the window hash is not already a tab ID.
options.onBeforeChangeCallback to be executed before changing tabs.
options.onChangeCallback to be executed after changing tabs.
options.menuSelector'.tabs-nav'Selector to find your tab links.
options.contentSelector'.tabs-content'Selector to find your tab content panes.
options.triggerEventsOnLoadtrueCall the above callbacks after this component is created.
A home is a dwelling-place used as a permanent or semi-permanent residence for an individual, family, household or several families in a tribe. It is often a house, apartment, or other building, or alternatively a mobile home, houseboat, yurt or any other portable shelter. Larger groups may live in a nursing home, children's home, convent or any similar institution. A homestead also includes agricultural land and facilities for domesticated animals. Where more secure dwellings are not available, people may live in the informal and sometimes illegal shacks found in slums and shanty towns. More generally, "home" may be considered to be a geographic area, such as a town, village, suburb, city, or country
News is the communication of selected information on current events. It is shared in various ways: among individuals and small groups (such as by word of mouth or newsletters); with wider audiences (such as by publishing, either in print or online, or broadcasting, such as on television or radio); or in ways that blend those traits (such as when social media sharing starts among individuals but goes viral).
Stuff or Stuffed may refer to:
Gets the currently active section
(Each section contains content for a tab, and must have an
Gets the currently active Menu link (the links which the user clicks on to change tabs)
Returns the active tab id
Changes the active tab
Pass a selector/element identifying what tab you want
selectorSelector of the desired tab or the link that links to it
Unregisters the component and removes its markup
Disables the desired tab
selectorthe id of the desired tab or the link that links to it
Enables the desired tab
selectorThe id of the desired tab or the link that links to it