epub 3, how to prevent pages from running in background ? (iBooks / Readium)

痞子三分冷 提交于 2019-12-12 10:09:44

问题


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:

  1. Does anyone know why?

  2. Is there a way to prevent an eReader from running or loading pages you are currently not viewing?

  3. 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).


回答1:


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.




回答2:


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!