kobolabs / epub-spec

Details on the elements of the ePub spec that Kobo supports, as well as other information on the Kobo reading platforms.
Other
191 stars 20 forks source link

touch event does not work on eink kobo? #52

Open mrbbp opened 4 years ago

mrbbp commented 4 years ago

hello, i tried your code exemple to catch touchevent on my kobo aura (N514) with 4.20.14622 and kepub extension

document.querySelector("main").addEventListener('click', handleClick, false);
 document.querySelector("main").addEventListener('touchstart', handleTouch, false);

function handleClick(event) {
    event.preventDefault();
}

function handleTouch(event) {
    exampleElement.style.background="red";
    event.preventDefault();
}
  }

but the main menu interact over my script. what's wrong?

oh and alert() don't too (for debugging).

mrbbp commented 4 years ago

nobody answer? Any idea? is it the good place for asking an upgrade? é.

daniel-j commented 4 years ago

The spec states:

Kobo’s eInk and Desktop platforms have limited support for JavaScript, and do not support interactive JavaScript elements.

Also, your code isn't complete: How is the main element used in your markup? Where is exampleElement defined? Extra trailing }

Instead of alert or console.log you can append nodes or set innerHTML of an element.