sharing information between pages

3 posts / 0 new
Last post

i know window.localstorage is usually unavailable in an epub page,though window.sessionstorage is. i know meta data can be used on a page or a javascript variable. but, how can two pages share information when it is needed.
For example, if the normal background color on my page is blue,and i want the color to change to red if someone skip two page, how do i accomplish it. I have not successfully shared data between two pages in my ebook. can someone help?

In general color at least for XHTML content documents can be considered to be styling.
Therefore you can provide alternative stylesheets.
Interpretation is required for EPUB.
Color within SVG content documents can be considered relevant content and there are often
more colors relevant than just one foreground- and one background-color.
Here one can use for example use elements or reference external issues with other elements,
can provide alternative stylesheets as well. But because interactivity is disallowed by EPUB for SVG content documents, the audience cannot select, for example with as well disallowed declarative animations. EPUB blocks interesting features of the format here.

Unfornately in practice, implementors care not much about such requirements like those to support access to alternative stylesheets.
I think, for most of them one cannot even switch as a user to an alternative stylesheet or to
use an own stylesheet. This is or was better with viewers for webpages, but finally most of them manage only to provide alternative stylesheets to single documents, users have to switch every time again. For EPUB archives it is obviously much simpler for programs to identify automatically, that the same alternative stylesheet applies to the next page as well, however, as already mentioned, implementors typically ignore such chances to provide programs with a good usability for the audience.

In web-projects one has an additional option with something like PHP to move the selected style from one page to another with GET-parameters in links for example, but there is no such language and option within EPUB of course.

To conclude: In practice there is no really reliable method to do this.
But one can already now provide alternative stylesheets for a maybe better future with better implementations for the audience.

thanks OH, I realize in the end, the ebook i am working on will not be as smooth stylisticaly as i like.

Secondary menu