View Single Post
Old 08-23-2018, 11:39 AM   #1
Barra
Junior Member
Barra began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Aug 2018
Device: none
Detect what pages are shown

I have a fixed layout book, the xhtml of Chapter 1 is presented below. How do I detect using javascript what pages are currently visible to the reader?

Code:
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
<head>
<title>My Book</title>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>

<style>

p.pagebreak {
    page-break-after:always;
} 

</style>
</head>

<body> 

    <p>
        Text on Page 1
    </p>

    <p class="pagebreak"></p>

    <p>
        Text on Page 2
    </p>

    <p class="pagebreak"></p>

    <p>
        Text on Page 3
    </p>

    <p class="pagebreak"></p>

    <p>
        Text on Page 4
    </p>


</body>
</html>
Barra is offline   Reply With Quote