我需要html页面的空白区域。
如何计算使用JavaScript标记的红色?
对不起,如果我的问题很傻
最佳答案
您希望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/