• 周一. 12月 11th, 2023

5G编程聚合网

5G时代下一个聚合的编程学习网

热门标签

计算 手机端页面高度和宽度

admin

11月 28, 2021
      init() {
                // 屏幕的高度
                let windowHeight = wx.getSystemInfoSync().windowHeight;
                let windowWidth = wx.getSystemInfoSync().windowWidth // 屏幕的宽度
                let ratio = 750 / windowWidth;
                this.scroll_height = (windowHeight - 50) * ratio;
                console.log(this.scroll_height)
            },
            rightHeightFun() {
                // 屏幕的高度
                let windowHeight = wx.getSystemInfoSync().windowHeight;
                let windowWidth = wx.getSystemInfoSync().windowWidth // 屏幕的宽度
                let ratio = 750 / windowWidth;
                this.rightHeight = (windowHeight - 95) * ratio;
            },

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注