Obtains the layout and position information of the menu button (capsule button in the upper right corner). The upper left corner of the screen acts as the coordinate origin.
The layout information includes the left and right margins of the atomic service menu bar.
Since: 1.0.10
Returns
Object containing the layout position information of the back menu button, including the following fields.
Parameter
Type
Description
width
number
Width, in px.
height
number
Height, in px.
top
number
Top boundary coordinate, in px.
right
number
Right boundary coordinate, in px.
bottom
number
Bottom boundary coordinate, in px.
left
number
Left boundary coordinate, in px.
Example:
const res = has.getMenuButtonBoundingClientRect();
console.info(res.width);
console.info(res.height);
console.info(res.top);
console.info(res.right);
console.info(res.bottom);
console.info(res.left);