Set of functions to manage the TabBar.
add
Add a tab to the TabBar.
Syntax:
lg.tabs.add(tab);
Arguments:
- tab – (object)
- btn – (numeric) The tab to add or update. You can have 1 to 5 tabs.
- title – (string) Tab button label.
- icon – (string) Location of the locally hosted PNG file.
- callback – (function) Function to call when tab is clicked.
Example:
lg.tab.add({btn:1, title:'Home', icon:'img/home.png', callback:onclickTabOne});
badge
Add a red badge to the top right corner of the tab.
Syntax:
lg.tabs.badge(btn, value);
Arguments:
- btn – (numeric) The tab to add a badge to.
- value – (numeric) What to display in the badge.
Example:
lg.tab.badge({btn:1, value:5});
hide
Hides the TabBar if present.
Syntax:
lg.tabs.hide();
remove
Removes a tab from the TabBar.
Syntax:
lg.tabs.remove(btn);
Arguments:
- btn – (numeric) The tab number to remove.
Example:
lg.tab.remove(1);
select
Changes a tab to the select state. You will want to call this function when you want to set the selected state from the JavaScript. For example, a text link.
Syntax:
lg.tabs.select(btn);
Arguments:
- btn – (numeric) The tab to add a badge to.
Example:
lg.tab.select(1);
show
Displays the TabBar at the bottom of the screen, if not present.
Syntax:
lg.tabs.show();
