I have created and validated an ePub 3 which I am currently testing. I am using a fixed layout..
<meta property="rendition:layout">pre-paginated</meta>
<meta property="rendition:orientation">portrait</meta>
<meta property="rendition:spread">none< /meta>
It works nicely, however multiple pages seems to load and run at once when testing in different readers. I'm using jQuery's document ready to kick things off and play audio, run animations, etc.
When testing in iBooks I open the book to page 1 which loads and begins to run, but then I start hearing audio from page 2.. so the document ready function has fired for page 2 (because it has been loaded) even though I am not viewing it yet. In Readium it seems load and run every single page...
Three questions:
Does anyone know why?
Is there a way to prevent an eReader from running or loading pages you are currently not viewing?
Is there a way to detect (with javascript) when a page is being viewed? (I have tried adding focus event listener to the window but it didn't work).
Document ready seems not to work in ePub. After testing a bit, I noticed that my javascript did not wait my document is ready to start its work. I tested on iPad 1 (iOS 5.1.1) with 3.1 iBooks version. The "solution" I have is to estimate the loading time of your HTML document by any tool which does this, then multiply it by 2 or 3 (because javascript on iOS device is clearly as slow) and use settimeout() function with the obtained time.
The problem is in Redium. you should manually set the settings to make it as two page.
into the Redium, go to settings then check the double pages
来源:https://stackoverflow.com/questions/13706725/epub-3-how-to-prevent-pages-from-running-in-background-ibooks-readium