小程序获取页面高度的代码示例:onReady: function () {//动态获取高度this.autoHeight();},//动态获取高度autoHeight:function(){var t
小程序获取页面高度的代码示例:
onReady: function () {//动态获取高度
this.autoHeight();
},
//动态获取高度
autoHeight:function(){
var that = this;
var query = wx.createSelectorQuery();
query.select('.container').boundinGClientRect(function(rect) {
console.log("----w" + rect.height)
that.setData({
windowHeight: rect.height ,//获取页面高度
})
}).exec();
},
--结束END--
本文标题: 小程序如何获取页面高度
本文链接: https://www.lsjlt.com/news/112279.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-05-02
2024-05-02
2024-05-02
2024-05-02
2024-05-02
2024-05-02
2024-05-02
2024-05-02
2024-05-02
2024-05-02
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0