Comment on page
Paging
Navigates to the specified page in the flipbook.
instance.paging.goToPage(4);
Navigates to the next page in the flipbook. If the flipbook has a spread-based layout, it will navigate to the next spread.
instance.paging.goToNextPage();
Navigates to the previous page in the flipbook. If the flipbook has a spread-based layout, it will navigate to the previous spread.
instance.paging.goToPrevPage();
Gets the current paging state.
// You can either await the result of the command
const result = await instance.paging.getState();
// OR pass a callback
instance.paging.getState((result) => {
// YOUR CODE HERE
});
The command will return an object with the following properties:
Property | Type | Description |
---|---|---|
currentSpread | number[] | The current visible pages of the flipbook |
spreads | Array of number[] | All spreads of the flipbook |
totalPages | number | Total amount of pages in the flipbook |
This subscription will trigger when the spread of a flipbook changes.
instance.paging.onChange((result) => {
// YOUR CODE HERE
});
The callback contains a value/result with the following properties:
Property | Type | Description |
---|---|---|
currentSpread | number[] | The current visible pages of the flipbook |
spreads | Array of number[] | All spreads of the flipbook |
totalPages | number | Total amount of pages in the flipbook |
Last modified 1mo ago