Hello,
Here is the link to the new version of this function which supports many pages.
We propose you to place the Grid component on the page and leave there an only cell. Grid is a container for the menu. Next you need to place in the single cell all the right buttons and menus, you can simply add actions to them. Besides, the mapping continues working with such menu!
Then, on Page Show event for FIRST page add Run JavaScript action with the following code:
precode// we need init panel only ONCE for first screen
if ( window.awesomeMenu == undefined) {
window.awesomeMenu = SlideMenu( Appery("mobilegrid_80"), Appery("mobilecontainer1") );
}/code/pre
Where mobilegrid_80 is the grid with one cell. Also it's important to pass page container (mobilecontainer1).
That is, the first parameter describes the menu container, the second is needed to determine page container.
The function takes three additional parameters:
side of the menu is displayed (by default, on the left) - the string "left" or "right";
type of appearance;
Theme Swatch.
Read more here.
Your menu is ready to call. You can add button to a header and add the following JavaScript on Click event:
precodewindow.awesomeMenu.panel("open");/code/pre
For the second and following pages where you need to use menu.
It's better to hide menu container with "Visible" flag. Otherwise it blinks when page appears.
For the second page add Page Show event with the following code:
precodewindow.awesomeMenu2 = SlideMenu( Appery("mobilegrid_2"), Appery( "mobilecontainer2" ), "right" );
Appery("mobilegrid_2").css({display: "table"});/code/pre
You needs to control naming for mobilecontainer and grids.
Please note that there is no code to check if menu exists and variable name is different.
And next -- there is no normal way to hardcode menu for all screens. Theoretically this can be done with flag "Render all pages in one HTML file". But we don't test this.