I want to display a popup around an element clicked on a page. To do so I get the coordinates of the element clicked from element.getBoundingClientRect() and use them to position the popup (the position property is 'absolute').
The problem is that it doesn't work for reflowable content as the position of the elements shown in the pages after the first one are relative to the top left of the page displayed whereas the absolute positioning is relative to the top left corner of the first page.
To solve this issue I would need to know the index of the page displayed or its offset. Any idea how to do this?
I tried to use values like window.pageXOffset/pageYOffset/scrollX/scrollY, document.body.offsetLeft without success (they are all equal to 0).
I managed to have it work on iBooks/MacOS but still have issues on iBooks/iOS so if any of you managed to code a popup window for epub files, I'm open to any advice!