mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-04 15:09:16 +02:00
106 lines
2 KiB
HTML
106 lines
2 KiB
HTML
<!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>
|
|
|
|
<style type="text/css">
|
|
body {
|
|
margin: 0;
|
|
background: #fafafa;
|
|
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
color: #333;
|
|
height: 100%;
|
|
width: 100%;
|
|
/* position: absolute; */
|
|
}
|
|
|
|
.epub-container {
|
|
/* display: block;
|
|
*/ /*width: 100%;*/
|
|
/*height: 100%;*/
|
|
/* text-align: center;
|
|
*/ /*position: absolute;
|
|
top: 0;
|
|
left: 0;*/
|
|
min-width: 320px;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
/*.epub-container > div {
|
|
padding: 0 20% 0 20%;
|
|
}*/
|
|
|
|
.epub-container .epub-view > iframe {
|
|
background: white;
|
|
box-shadow: 0 0 4px #ccc;
|
|
margin: 10px;
|
|
padding: 20px;
|
|
}
|
|
|
|
|
|
#prev {
|
|
left: 40px;
|
|
}
|
|
|
|
#next {
|
|
right: 40px;
|
|
}
|
|
|
|
.arrow {
|
|
position: fixed;
|
|
top: 50%;
|
|
margin-top: -32px;
|
|
font-size: 64px;
|
|
color: #E2E2E2;
|
|
font-family: arial, sans-serif;
|
|
font-weight: bold;
|
|
cursor: pointer;
|
|
-webkit-user-select: none;
|
|
-moz-user-select: none;
|
|
user-select: none;
|
|
}
|
|
|
|
.arrow:hover {
|
|
color: #777;
|
|
}
|
|
|
|
.arrow:active {
|
|
color: #000;
|
|
}
|
|
|
|
#toc {
|
|
display: block;
|
|
margin: 10px auto;
|
|
}
|
|
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="viewer"></div>
|
|
|
|
<script>
|
|
var currentSectionIndex = 8;
|
|
// Load the opf
|
|
var book = ePub("../books/moby-dick/OPS/package.opf");
|
|
var rendition = book.renderTo(document.body, { method: "continuous", width: "60%" });
|
|
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>
|