jsgetheight: function () { var that = this; //创建节点选择器 var query = wx.createSelectorQuery(); //选择class id query.select('#getheight').boundingClien_微信小程序获取元素宽度">
赞
踩
<view class="Outerlayer" id="getheight"></view>
js
- getheight: function () {
- var that = this;
- //创建节点选择器
- var query = wx.createSelectorQuery();
- //选择class id
- query.select('#getheight').boundingClientRect(function (rect) {
- that.setData({
- Height: rect.height
- })
- }).exec();
- },
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。