Manages page navigation. If using the NavigationBar, it will automatically add the page title and description to the bar. You can take advantage of navigation manually or automatically, using the LG JavaScript Framework.
error
Error object can be retrieved from this property if an error occurs.
Syntax:
lg.location.error;
Returns:
- (object) Error object.
Example:
var error = lg.navigation.error;
list
An array of pages currently managed by navigation. Each item contains an object with page properties.
Syntax:
lg.navigation.list;
Example:
var page = lg.navigation.list[0]; //First page object in list
add
Pushes the page object into the lg.navigation.list as well as adds the page to the NavigationBar. If using lg.page.add, it will automatically call on this function if the property, navigation is set to true in the page object.
Syntax:
lg.navigation.add(page);
Arguments:
- page – (object) Page object.
Example:
lg.navigation.add({id:'page_home', url:'home.html', title:'LiquidGear', desc:'Welcome to LG', callback:setHome, navigation:true});
hide
Hides the NavigationBar if present.
Syntax:
lg.navigation.hide();
next
Animates a new page into view.
Syntax:
lg.navigation.next(pageID);
Arguments:
- pageID – (string) Page id to diplay.
Example:
lg.navigation.next('page_home');
previous
Displays the previous page viewed.
Syntax:
lg.navigation.previous();
remove
Removes a page from the lg.navigation.list array.
Syntax:
lg.navigation.remove(pageID);
Arguments:
- pageID – (string) Page id to diplay.
Example:
lg.navigation.remove('page_home');
show
Displays the NavigationBar at the top of the screen, if not present.
Syntax:
lg.navigation.show();
