动态计算view高度

2022-07-12  本文已影响0人  廷裕同学
// 动态计算滚动区域高度
    computeScrollViewHeight(){
        let that = this;
        let query = wx.createSelectorQuery().in(this);
        
        query.select('.topmenu').boundingClientRect(function(res){
            let headHight = res.height;
            let screeHeight = wx.getSystemInfoSync().windowHeight;
            let scrollHeight = screeHeight - headHight;
            that.setData({
                scrollViewHeight:scrollHeight
            });
        }).exec();
    }
上一篇 下一篇

猜你喜欢

热点阅读