@derock.ir/epubjs-plus
v1.1.6
Published
A wrapper around epubjs project.
Downloads
11
Readme
Statefull Pagniated Epub Viewer
A wrapper around epubjs project.
Installation
npm i "@derock.ir/epubjs-plus"Usage
import {
library,
StatefulPaginatedEpubViewer,
} from '@derock.ir/epubjs-plus';
const epub = await library.addFromFileDialog();
const viewer = new StatefulPaginatedEpubViewer(epub);
await viewer.initialize();
await viewer.display(targetDom);Events
Rendering
relocated: on new page rendered. returns aRelocatedEventPayloadobject.content: on new content loaded. returns aDocumentobject.render: on new content rendered. returns aDocumentobject.page-changed: on page changes. sends aPaginationobject.
Pagination
pagination-update: on pagination info update. sends aPaginationUpdateEventPayloadobject.pagination-done: on pagination finished. sends aPaginationDoneEventPayloadobject.
Input events
swipe:left: gusture eventswipe:right: gusture eventtap: on tapclick-tap: on tap or click
