How does WeChat Mini Programs get the page height and subtract a certain view height

var bodyHeight = document.documentElement.clientHeight;

    var oCardbox = document.getElementById("cardbox");
    var oCardfoot = document.getElementById("cardfoot");
    var oCfheight = oCardfoot.clientHeight;

    oCardbox.style.height = bodyHeight - oCfheight + "px";
    
    
Jul.27,2021

Mini Program provides it. You can refer to it to get the api, of the device.


let query = wepy.createSelectorQuery()
query.select('-sharplist').boundingClientRect()
query.selectViewport().scrollOffset()
query.exec((res) => {
  this.listHeight = res[0].height
  this.listTop = res[0].top
})

window height

wx.getSystemInfo({
 success: function (res) {
   console.log(res.windowHeight)
 }
})

image.png

image.png

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b34db5-2bf60.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b34db5-2bf60.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?