原生js解决方案
var h = document.body.scrollHeight;
window.onresize = function(){
if (document.body.scrollHeight < h) {
document.getElementById(‘btn‘).style.display = ‘none‘;
}else{
document.getElementById(‘btn‘).style.display = ‘block‘;
}
};
原文:https://www.cnblogs.com/bbldhf/p/14061070.html