Javascript in reflowable layout

4 posts / 0 new
Last post

I am using an interaction like a button, with javascript, that is working in iBooks for desktop and Sigil. But in ipad and iphone, only works the first page. When I turn the visualization to scrolling, all the interaction works.
My javascript has "document.getElementById(id).className", i dont know like xhtml is more that one page, it doesnt understand.

Someone know what can be happening?


I'm not sure I understand. You have a button that sets a CSS class on an element, but which scenario do you mean:

  • if the button is on the first page and the element you're changing is on another page (i.e., not visible when you click it), the appearance doesn't change?
  • if the button and the element you're changing aren't both on the first page the appearance doesn't change, even if both are visible when you click the button?

I tried both scenarios in an ipad mini and both times the CSS class was applied to the element, so it's hard to know what issue you're running into.

It sounds like an problem repainting the content after a dynamic update when the content is paginated, but not being able to reproduce I couldn't say for sure, or what would fix it.

Thanks for the reply, matt.
Actually, I have many buttons, that sets a CSS class. This xhtml has 2 pages in iPad, and 4 pages in iPhone.
The buttons in first page is ok, but the others isnt working.
If I break the xhtml in each page, they work.

Can you understand?

If you cause the content to change in such a way that it should force repagination things tend to break. With dynamic pagination, content disappears off the bottom of the page never to be seen again to accommodate the restyled content (e.g. if bumping up the font size on a paragraph). Is that along the lines of what's happening to you, or is no change occuring at all?

That sort of restyling will work in a scrolled view as it's more like a browser interface and the scroll length just expands to accommodate the increase in content. Chunking content to fit pages does have its quirks.

Secondary menu