首页 > 移动平台 > 详细

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

时间:2021-08-15 11:46:02      阅读:21      评论:0      收藏:0      [点我收藏+]
      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;
            },

 

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

原文:https://www.cnblogs.com/Sabo-dudu/p/15142860.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!