title: Taro.onWindowResize(callback)
sidebar_label: onWindowResize
Listens on the window size change event.
Reference
Type
(callback: Callback) => void
Parameters
Callback
The callback function for the window size change event.
(result: CallbackResult) => void
Property |
Type |
result |
CallbackResult |
CallbackResult
Size
Property |
Type |
Description |
windowHeight |
number |
New window width (in px) |
windowWidth |
number |
New window height (in px) |
API Support
API |
WeChat Mini-Program |
H5 |
React Native |
Taro.onWindowResize |
✔️ |
✔️ |
✔️ |