wx.createSelectorQuery返回的top值有误,不稳定,是根据什么判断的?

发布于 8 年前作者 yangxiulan11616 次浏览最后编辑 8 年前来自 ask

this.createSelectorQuery().select("#footer").boundingClientRect((res) => {

          if (!resreturn;

          let top = res.top;

          let height = windowHeight - res.height;

          console.log(res)

          console.log(top)

          console.log(height)

          if (top < height{

            console.log('进来了')

            this.setData({

              fix: true

            })

          }

        }).exec();

1 回复
pingfang
pingfang1 楼6 年前

你好,真机是否有问题?请提供能复现问题的代码片段看下(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html