EZ Catalog
Book reading is a very common UI effect to provide different browsing experience for users.
With <msc-ez-catalog />
, developers could adopt this feature to web page easier.
All developers need to do is just providing series image paths in config and everything will be all set.
Check the following examples to see what can <msc-ez-catalog />
do ?
Basic Usage
<msc-ez-catalog />
is a web component. All we need to do is put the required script into your HTML document. Then follow <msc-ez-catalog />
's html structure and everything will be all set.
Required Script
Structure
Put <msc-ez-catalog />
into HTML document. It will have different functions and looks with attribute mutation.
JavaScript Instantiation
<msc-ez-catalog />
could also use JavaScript to create DOM element. Here comes some examples.
Style Customization
Developers could apply styles to decorate <msc-ez-catalog />
's looking.
Attributes
<msc-ez-catalog />
supports some attributes to let it become more convenience & useful.
pages
Set pages' image path for <msc-ez-catalog />
. Once setting, <msc-ez-catalog />
will re-render all pages.(pages should be array and has more than 4 children)
Keyboard shortcuts
Key | Description |
---|---|
←
|
Go to previous flip. |
→
|
Go to next flip. |
f
|
Toggle fullscreen.(same as double click <msc-ez-catalog />) |
Methods
Method Signature | Description |
---|---|
prev()
|
Go to previous flip. |
next()
|
Go to next flip. |
seekTo(index = 1)
|
Switch to flip index. index will be correct to flip count once more than flip count. |
Property
Property Name | Type | Description |
---|---|---|
pages
|
Array | Getter / Setter for pages' image path. |
currentflip
|
Number | Getter for current flip. |
flipcount
|
Number | Getter for flipcount. |
Event
Event Signature | Description |
---|---|
msc-ez-catalog-flip
|
Fired when flip occured. Developers can gather pages' information through event.detail . |