小程序獲取菜單按鈕的布局位置wx.getMenuButtonBoundingClientRect
Object wx.getMenuButtonBoundingClientRect()
獲取菜單按鈕(右上角膠囊按鈕)的布局位置信息。坐標信息以屏幕左上角為原點。
返回值
Object
菜單按鈕的布局位置信息
屬性 類型 說明
width number 寬度,單位:px
height number 高度,單位:px
top number 上邊界坐標,單位:px
right number 右邊界坐標,單位:px
bottom number 下邊界坐標,單位:px
left number 左邊界坐標,單位:px
示例代碼
const res = wx.getMenuButtonBoundingClientRect()
console.log(res.width)
console.log(res.height)
console.log(res.top)
console.log(res.right)
console.log(res.bottom)
console.log(res.left)
- 小程序開始下拉刷新
- 開始下拉刷新。調用后觸發下拉刷新動畫,效果與用戶手動下拉刷新一致。
- 04-06 關注:0