Mouse and Touch Events

3 posts / 0 new
Last post

We have an issue with our interactive books on the ipad. We are using epub3, javascripts and event listeners. All interactivity works perfectly on the ipad using eventlistener for touch. When we download the book to mac-maverick-ibooks there is no issue with the mouse events working on the touch events.. Apple want the books to include javascript to handle both touch or mouse events for each device. We attempted to include mouse events with the touch events without success. Does anyone know how to handle this. This is a snippet of the code we tried to use without success.

var eventName = "click";

if (navigator.epubReadingSystem.hasFeature('touch-events')) { eventName = "touchstart"; }

if (document.getElementById('openpopup')) { document.getElementById('openpopup').addEventListener(eventName,popup,false); }

iBooks for Mac OS X seems buggy/incomplete.

For example, it does not expose property navigator.epubReadingSystem.name, so it might not expose navigator.epubReadingSystem.hasFeature('touch-events') either.

As a workaround, did you tried binding listeners for both "click" and "touchstart" events?

If you encounter a bug with iBooks, please file bugs against that with Apple. That's the only way we can get these issues escalated with the engineering team there.

Log in to: http://bugreport.apple.com

Be sure to start out the subject of your bug with something along the lines of:

iBooks for [iOS or Mac]: [Problem you've encountered]

Be specific with your reporting. This is the only way the iBooks team will see these problems, and the more people who file similar bugs the better the chances are of Apple actually paying attention to them.

Secondary menu