<overlay><overlay> is an element designed specifically for Hybrid Apps; its children can break out of the LynxView document flow and be fixed to the native page.
<overlay> to build dialogs/modals.<overlay> is not recommended; using position: fixed directly is simpler.<overlay> can only have one direct child, and <overlay> itself must set a required CSS property:
<overlay style="position: fixed;/><overlay> is just a container and occupies no space, so it does not need any width or height and does not affect the parent container's layout.<overlay> automatically places its inner children at appropriate layers; you do not need to set z-index, translateZ, etc.<overlay> uses the screen size as its width/height baseline by default; we recommend using it as a dedicated container for all rendering content.
width:100%; height:100%;margin and other parameters inside this child node.<overlay>:
position: absolute but must not use position: fixed inside.z-index, ensure the stacking context is <overlay> itself; otherwise, elements will attach to <page>.<overlay> to create a dialog
ios-enable-swipe-backWhen overlay is displayed, 'true' allows swiping right to close the current page, 'false' does not allow it
levelIntroduces the concept of layers, which are divided into four levels. The larger the layer, the closer it is to the bottom. By default, it is the first level. The layers are arranged in order from 1 to 4. The displayed layer is specified and is not affected by the order of display. Within each layer, the arrangement is based on the 'last in, first out' logic. The layer cannot be dynamically adjusted when the overlay is displayed, and can only be adjusted when it is hidden. *
modeSpecifies the level at which the overlay content resides on iOS. window: Mounted on the window, the top level of the app; top: Mounted on the topViewController; page: Mounted on UINavigationController; others: customize the name of class in the client.
visibleControl whether the overlay is displayed
Frontend can bind corresponding event callbacks to listen for runtime behaviors of the element, as shown below.
binddismissoverlayCallback when the overlay is hidden.
binderror| Field | Type | Optional | Default | Platforms | Since | Description |
|---|---|---|---|---|---|---|
| errorCode | string | No | – | Android only | Error code: 0 - Display normally; non-0 - Unable to display, you can try to solve it by using the preloading scheme mentioned below for adapting containers. | |
| errorMsg | string | No | – | Android only | Error message |
Callback when touch on the overlay
bindoverlaytouch| Field | Type | Optional | Default | Platforms | Since | Description |
|---|---|---|---|---|---|---|
| state | OverlayTouchState | No | – | Android only iOS only Clay only | Touch state | |
| x | number | No | – | Android only iOS only Clay only | x position relative to the window, in px | |
| y | number | No | – | Android only iOS only Clay only | y position relative to the window, in px |
Callback when touch on the overlay
bindrequestcloseCallback when the back button is clicked.
bindshowoverlayCallback when the overlay is displayed
LCD tables only load in the browser