获取动态元素高度

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

 

posted @ 2018-07-11 18:28  boyanh  阅读(1958)  评论(0编辑  收藏  举报