API/libsapojs/SAPO/Component/Tabs

[Elements] are optional

Class SAPO.Component.Tabs


class SAPO.Component.Tabs
Defined in Component/Tabs/0.1/lib.js

Constructor Summary
Tabs (Object options)

Function Summary
activateTab (Number index, Boolean isNested)
Activates a tab
DOMElement getTabs()
Returns the DOM elements generated for programatically created tabs
Boolean hasNested()

Constructor Details

constructor Tabs

Tabs(Object options)
Parameters:
Element object
options - options for the new tab set
  • [ elementID|DOMElement container ] - tab container
  • [ Array tabs ] - Array containing definitions for each tab. Each tab can have the following parameters: title - title displayed on the tab menu content - string with html or a callback which returns a string contentURL - url which returns html through XMLHttpRequest events - events which are applied to the content loaded on the tab. receives the DOM tab container as a parameter
  • Function loadCallback - callback executed after loading on any tab. receives the DOM tab container and the object from the tabs array as a parameter
  • String tabNavClass - class applied to the navigation menu
  • String tabContainerClass - class applied to the tab container
  • String activeNavClass - class applied to the currently active tab menu item
  • String activeContainerClass - class applied to the currently active container
  • String nojsContainerClass - class that will be removed which is used when javascript is deactivated
  • Boolean cache - if cache is activated, tabs are created on the DOM or loaded through XMLHttpRequest only the first time

Function Details

function activateTab

activateTab(Number index, Boolean isNested)
Activates a tab
Parameters:
index - Index (from 0 to n) of the tab to activate
isNested - If the tab to activate is a nested tab
Returns:
Array of nested tabs

function getTabs

DOMElement getTabs()
Returns the DOM elements generated for programatically created tabs

function hasNested

Boolean hasNested()
Returns:
True if current instance has nested tabs