Random page selection from multi-page html5 document

21 views
Skip to first unread message

spored...@gmail.com

unread,
Mar 2, 2016, 9:15:37 AM3/2/16
to Google Web Designer beta
Hello,

I'm trying to create a multi-page html5 document that has a button to allow the selection of a random page from a set of pages in the page deck. There would be 8 pages in total in the deck: A title page (pg. 1) 6 random content pages (pgs. 2-7) and a conclusion page (pg.8)

The first page would have a button that would call a page from pages 2-7. The button would be replicated on each page and would allow you to get 3 pages from the page set (say 3, 6 and 4). Each time the button is pressed it adds +1 to a variable (let's call it "P") so that when "P" == 3 the button would load the last page.

This version is a test build for a larger project. I'm relatively new to coding with JavaScript, but I have seen this done with arrays. The final version may have up to 80 pages, so I'm looking for a simpler way to handle page transitions if I can. I have a few questions:

1. Is it possible to do the same thing with custom scripts in GWD? If so, how would you call the other pages?

2. If you have a multi-page document and need to declare variables that would exist throughout the document, where would you declare them? Would they be accessible to all pages if the variables are declared on the main page or do the variable have to be declared on each page?

Any help would be appreciated!

Thanks!

Reply all
Reply to author
Forward
0 new messages