epubjs
Version:
Render ePub documents in the browser, across many devices
20 lines (16 loc) • 452 B
JavaScript
if(window.parent != window.self || EPUBJS.Reader) {
return;
}
var EPUBJS.Reader = {};
var currentSectionIndex = 0;
// Load the opf
var book = ePub("../books/3a4284f53b99cc8bd2ccaa7c3e775aa6/content.opf");
var rendition = book.renderTo("viewer");
var displayed = rendition.display(currentSectionIndex);
displayed.then(function(renderer){
// -- do stuff
});
// Navigation loaded
book.loaded.navigation.then(function(toc){
// console.log(toc);
});