原生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'; } };