1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-05 15:32:55 +02:00
epub.js/examples/basic-render.html
2014-08-06 12:22:37 -04:00

86 lines
1.4 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>EPUB.js Basic Example</title>
<script src="../dist/epub.js"></script>
<style type="text/css">
body {
margin: 0;
}
#viewer {
/* position: absolute;
left: 10%;
width: 80%;
height: 100%;
overflow: hidden; */
display: block;
margin: 50px auto;
width: 600px;
}
#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 = 10;
// Load the opf
var book = ePub("../books/moby-dick/OPS/package.opf");
var rendition = book.renderTo("viewer", {width: 600, height: 400});
var displayed = rendition.display(currentSectionIndex);
displayed.then(function(renderer){
// -- do stuff
});
// Navigation loaded
book.loaded.navigation.then(function(toc){
// console.log(toc);
});
</script>
</body>
</html>