Set of functions to manage the TabBar.

 

add

Add a tab to the TabBar.


Syntax:

lg.tabs.add(tab);

Arguments:

  1. 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});

Back to Top

 

 

badge

Add a red badge to the top right corner of the tab.


Syntax:

lg.tabs.badge(btn, value);

Arguments:

  1. btn – (numeric) The tab to add a badge to.
  2. value – (numeric) What to display in the badge.


Example:

lg.tab.badge({btn:1, value:5});

Back to Top

 

 

hide

Hides the TabBar if present.


Syntax:

lg.tabs.hide();

Back to Top

 

 

remove

Removes a tab from the TabBar.


Syntax:

lg.tabs.remove(btn);

Arguments:

  1. btn – (numeric) The tab number to remove.


Example:

lg.tab.remove(1);

Back to Top

 

 

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:

  1. btn – (numeric) The tab to add a badge to.


Example:

lg.tab.select(1);

Back to Top

 

 

show

Displays the TabBar at the bottom of the screen, if not present.


Syntax:

lg.tabs.show();

Back to Top