最佳答案
您希望 HTML 文档的距离减去屏幕的高度:
var html = document.documentElement;
var doc_height = Math.max(html.clientHeight, html.scrollHeight, html.offsetHeight);
var height = (screen.height > doc_height ? screen.height-doc_height : 0); //if the space exists, else return 0
关于javascript - 是否可以计算 html 页面的空白区域?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55720249/