获取动态元素高度

      //创建节点选择器
      var query = wx.createSelectorQuery();
      //选择id
      query.select('#content').boundingClientRect()
      query.exec(function (res) {
        //res就是 所有标签为mjltest的元素的信息 的数组
        console.log(res);
        //取高度
        console.log(res[0].height);
      })

猜你喜欢

转载自www.cnblogs.com/linsx/p/9296085.html