Stay organized with collections
Save and categorize content based on your preferences.
Registers a callback that's fired when the script starts and whenever the browser window size changes. It will be passed an object with boolean fields "is_mobile", "is_tablet", "is_desktop", "is_portrait" and "is_landscape", and numeric fields "width" and "height".
These fields indicate whether a user's device is mobile, tablet or desktop, the device orientation (portrait or landscape), and the width and height of the window in pixels. See the Width and Height (dp) section of device metrics at https://material.io/resources/devices/.
Usage
Returns
ui.root.onResize(callback)
Argument
Type
Details
callback
Function
The callback to fire after the window has been resized. The callback is passed an object with the information of the device.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-10-06 UTC."],[[["Triggers a provided function when the webpage loads or the browser window is resized."],["Provides details about the device used, such as whether it is a mobile, tablet, or desktop, its orientation (portrait or landscape), and the window's dimensions in pixels."],["Utilizes boolean fields (\"is_mobile\", \"is_tablet\", \"is_desktop\", \"is_portrait\", \"is_landscape\") and numeric fields (\"width\", \"height\") within a passed object to convey device information."],["Can be implemented using `ui.root.onResize(callback)`, where `callback` represents the function to be executed."]]],[]]