解决思路:延时一点时间再去获取内容的高度
const oBox=document.getElementById("headbox"); setTimeout(function(){ console.log(oBox.scrollHeight) },100)
解决思路:延时一点时间再去获取内容的高度
const oBox=document.getElementById("headbox"); setTimeout(function(){ console.log(oBox.scrollHeight) },100)