Loads a new HTML page inside the stage. A div with the id, stage, is required.
create
Manually creates a page. Pages can also be created from a div and a hyperlink.
Syntax:
lg.page.create(page);
Arguments:
- page – (object) Page object.
Example:
lg.page.create({id:'page_home', url:'home.html', title:'LiquidGear', desc:'Welcome to LG', callback:setHome, navigation:true});
current
Contains the page id of the page currently in view.
Syntax:
lg.page.current;
Returns:
- (string) Page id.
Example:
var pageID = lg.page.current;
getByID
Get a page object by its id.
Syntax:
lg.page.getByID(id);
Arguments:
- id – (string) Page id.
Example:
lg.page.getByID('page_home');
getByURL
Get a page object by its url.
Syntax:
lg.page.getByURL(url);
Arguments:
- url – (string) Page url.
Example:
lg.page.getByURL('home.html');
list
An array of pages being used. Each item contains an object with page properties.
Syntax:
lg.page.list;
Returns:
- (array) Array of page objects.
Example:
var page = lg.page.list[0]; //First page object in list
next
Contains the page id of the page that was previously viewed if the back button was pressed. The page that was in view but now off to the right.
Syntax:
lg.page.next;
Returns:
- (string) Page id.
Example:
var pageID = lg.page.next;
open
Opens a page into the main stage. If you may only want to use this function if you are loading a single page. Otherwise, it is recommended to add the page (using lg.page.add) and then open it using lg.page.next.
Syntax:
lg.page.open(page);
Arguments:
- page – (object)
- url – (string) A url pointing to the page to be loaded.
- callback – (function) Function to call once page is loaded.
Example:
lg.page.open({url:'home.html', callback:onOpen});
previous
Contains the page id of the page that was previously viewed. THe page that was in view but now off to the left.
Syntax:
lg.page.previous;
Returns:
- (string) Page id.
Example:
var pageID = lg.page.previous;
remove
Removes a page from the lg.page.list array.
Syntax:
lg.page.remove(pageID);
Arguments:
- pageID – (string) Page id to diplay.
Example:
lg.page.remove('page_home');
slideIn
Slides a page into view from left to right.
Syntax:
lg.page.slideIn(pageID);
Arguments:
- pageID – (string) Page id to diplay.
Example:
lg.page.slideIn('page_home');
slideLeft
Slides a page out of view to the left.
Syntax:
lg.page.slideLeft(pageID);
Arguments:
- pageID – (string) Page id to diplay.
Example:
lg.page.slideLeft('page_home');
slideRight
Slides a page out of view to the right.
Syntax:
lg.page.slideRight(pageID);
Arguments:
- pageID – (string) Page id to diplay.
Example:
lg.page.slideRight('page_home');
