setScrollMode
Start from API_LEVEL
2.0
. Please refer to API_LEVEL.
Set the scroll mode of the page.
Type
function setScrollMode(option: Option): Result
Parameters
Option
Property | Type | Required | DefaultValue | Description | API_LEVEL |
---|---|---|---|---|---|
mode | string | Y | - | Page scroll mode, value reference page scroll mode constants | 2.0 |
options | Options | N | - | Other Options | 2.0 |
Options
Property | Type | Required | DefaultValue | Description | API_LEVEL |
---|---|---|---|---|---|
height | number | N | - | Specify the height of a single item in Swiper, effective only if the scroll mode is SCROLL_MODE_SWIPER | 2.0 |
count | number | N | - | Specify the number of items in the Swiper, effective only if the scroll mode is SCROLL_MODE_SWIPER or SCROLL_MODE_SWIPER_HORIZONTAL | 2.0 |
width | number | N | - | Specify the width of a single item in Swiper, effective only if the scroll mode is SCROLL_MODE_SWIPER_HORIZONTAL | 2.1 |
Result
Type | Description |
---|---|
number | If true is returned, success is indicated |
Constants
Page scroll mode constants
Constant | Description | API_LEVEL |
---|---|---|
SCROLL_MODE_FREE | Free scrolling mode, system default scrolling mode | 2.0 |
SCROLL_MODE_SWIPER | Swiper mode, vertical rotating map, walking lights, by configuring the height and number of individual pages can achieve the whole screen scrolling effect | 2.0 |
SCROLL_MODE_SWIPER_HORIZONTAL | Swiper mode, horizontal rotating map, walking lights, by configuring the width and number of individual pages can achieve the whole screen scrolling effect | 2.1 |
Example
import { setScrollMode, SCROLL_MODE_SWIPER } from '@zos/page'
setScrollMode({
mode: SCROLL_MODE_SWIPER,
options: {
height: 480,
count: 10,
},
})