PageList
Continuous page view: lays out every page of a document one below the other inside a scroll container, renders only the pages near the visible area, and reports which page is current while the user scrolls.
Framework-neutral; the React and Vue viewers wrap it.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new PageList( scroller, host, options?): PageList;Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
scroller |
HTMLElement |
the scrolling element (overflow: auto) |
host |
HTMLElement |
element inside scroller that receives the page slots |
options |
PageListOptions |
- |
Returns
Section titled “Returns”PageList
Accessors
Section titled “Accessors”currentPage
Section titled “currentPage”Get Signature
Section titled “Get Signature”get currentPage(): number;Index of the page currently considered visible.
Returns
Section titled “Returns”number
pageElements
Section titled “pageElements”Get Signature
Section titled “Get Signature”get pageElements(): readonly HTMLElement[];Page slot elements, one per page.
Returns
Section titled “Returns”readonly HTMLElement[]
Methods
Section titled “Methods”destroy()
Section titled “destroy()”destroy(): void;Returns
Section titled “Returns”void
scrollToPage()
Section titled “scrollToPage()”scrollToPage(index): void;Scrolls so the top of a page is at the top of the scroll container.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
index |
number |
Returns
Section titled “Returns”void
update()
Section titled “update()”update(next): void;Applies new inputs. Rebuilds the slots when the document or zoom changed.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
next |
PageListState |
Returns
Section titled “Returns”void