Skip to main content
Version: v3+

setScrollLock

Start from API_LEVEL 2.0 . Please refer to API_LEVEL.

Set the current page scrolling position to be locked, i.e. the screen position will not change with the gesture swipe. After calling this API to perform the unlock operation, the page scrolling mode will be set to free scrolling mode.

Type​

function setScrollLock(option: Option): void

Parameters​

Option​

PropertyTypeRequiredDefaultValueDescriptionAPI_LEVEL
lockbooleanNtrueWhether to lock the current page scroll position2.0

Example​

import { setScrollLock } from '@zos/page'

setScrollLock({
lock: true,
})