You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use cloud reader lite to display an epub. Since there is no support for content tagged epub:type noteref, I made it myself (based on a script from epub.js) and I add it inside the epub content.
This works really fine on desktop, there is a small popover displayed on mouseover near the word to be defined. But on tablet, there is no onmouseover event, just the click event.
And when I click a link, the link is followed, whether it's an external link or an anchor.
varlinks=document.getElementsByTagName('a');for(vari=0;i<links.length;i++){if(links[i].getAttribute('epub:type')==='noteref'){links[i].addEventListener("mouseover",showPop,false);links[i].addEventListener("mouseout",hidePop,false);links[i].addEventListener("click",disableClick,false);}}functiondisableClick(e){console.log('I was clicked');e.preventDefault();e.stopPropagation();}
"I was clicked" is displayed but the preventDefault() does nothing, the click event is not stopped.
How can I prevent a link in the epub to open a new tab or to go the corresponding anchor ?
The text was updated successfully, but these errors were encountered:
Just to be clear, there is support for EPUB3 "popup" footnotes in a feature branch, in fact we discussed progress during one of last week's conference calls.
I use cloud reader lite to display an epub. Since there is no support for content tagged epub:type noteref, I made it myself (based on a script from epub.js) and I add it inside the epub content.
This works really fine on desktop, there is a small popover displayed on mouseover near the word to be defined. But on tablet, there is no onmouseover event, just the click event.
And when I click a link, the link is followed, whether it's an external link or an anchor.
"I was clicked" is displayed but the preventDefault() does nothing, the click event is not stopped.
How can I prevent a link in the epub to open a new tab or to go the corresponding anchor ?
The text was updated successfully, but these errors were encountered: