OptionalbookDirection lock for the current touch gesture. Once the first significant movement (>5 px) determines the dominant axis, the lock stays for the rest of the gesture. 'vertical' means native scroll wins — Hammer pan events are rejected. 'horizontal' means every touchmove gets preventDefault() so Hammer can drive the page flip.
Get the index of the current (leftmost visible) page. Returns 0 if no pages are visible.
Check if the book is currently showing the first page(s).
Check if the book is currently showing the last page(s).
Get the total number of pages in the flipbook.
Clean up event listeners and Hammer instance. Should be called when the FlipBook is no longer needed.
Animate flip to the next page.
Promise that resolves when the flip animation completes
Animate flip to the previous page.
Promise that resolves when the flip animation completes
Animate to a specific page index. Flips through pages sequentially to reach the target.
The target page index (0-based)
Promise that resolves when all flip animations complete
Download config (handlers and filename hints). Used by toolbar.
Get the configured table of contents page index.
Jump to a specific page instantly without animation.
The target page index (0-based)
Core FlipBook class for creating realistic page-flip animations.
Example