forked from futurepress/epub.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontinuous-scrolled.html
65 lines (51 loc) · 1.33 KB
/
continuous-scrolled.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>EPUB.js Continuous Example</title>
<script src="../dist/epub.js"></script>
<link rel="stylesheet" type="text/css" href="examples.css">
<style type="text/css">
.epub-container {
/* min-width: 320px; */
/* margin: 0 auto; */
/* position: relative; */
}
.epub-container .epub-view > iframe {
background: white;
box-shadow: 0 0 4px #ccc;
/*margin: 10px;
padding: 20px;*/
}
#viewer {
width: 600px;
height: 100vh;
/* overflow: auto; */
margin: 0 auto;
}
</style>
</head>
<body>
<div id="viewer"></div>
<script>
var currentSectionIndex = 8;
// Load the opf
var book = ePub("https://s3.amazonaws.com/epubjs/books/moby-dick/OPS/package.opf");
var rendition = book.renderTo("viewer", {
manager: "continuous",
flow: "scrolled",
width: "100%",
height: "100%"
});
var displayed = rendition.display("epubcfi(/6/14[xchapter_001]!4/2/24/2[c001p0011]/1:799)");
displayed.then(function(renderer){
// -- do stuff
});
// Navigation loaded
book.loaded.navigation.then(function(toc){
// console.log(toc);
});
</script>
</body>
</html>