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;

Back to Top

 

 

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

Back to Top

 

 

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:

  1. page – (object) Page object.


Example:

lg.navigation.add({id:'page_home', url:'home.html', title:'LiquidGear', desc:'Welcome to LG', callback:setHome, navigation:true});

Back to Top

 

 

hide

Hides the NavigationBar if present.


Syntax:

lg.navigation.hide();

Back to Top

 

 

next

Animates a new page into view.


Syntax:

lg.navigation.next(pageID);

Arguments:

  1. pageID – (string) Page id to diplay.


Example:

lg.navigation.next('page_home');

Back to Top

 

 

previous

Displays the previous page viewed.


Syntax:

lg.navigation.previous();

Back to Top

 

 

remove

Removes a page from the lg.navigation.list array.


Syntax:

lg.navigation.remove(pageID);

Arguments:

  1. pageID – (string) Page id to diplay.


Example:

lg.navigation.remove('page_home');

Back to Top

 

 

show

Displays the NavigationBar at the top of the screen, if not present.


Syntax:

lg.navigation.show();

Back to Top