三个高属性
1.屏幕可视区高度
document.documentElement.clientHeight;
2.页面的高度
document.documentElement.scrollHeight;
3.滚动条当前高度
document.documentElement.scrollTop;
document.body.scrollTop;(chrome)今天测试时发现谷歌浏览器不再使用该方法,而是使用上述上面的方法,而edge浏览器反而需要使用该方法。
Rcid ©著作权
文章标签 js 文章分类 JavaScript 前端开发
三个高属性
1.屏幕可视区高度
document.documentElement.clientHeight;
2.页面的高度
document.documentElement.scrollHeight;
3.滚动条当前高度
document.documentElement.scrollTop;
document.body.scrollTop;(chrome)今天测试时发现谷歌浏览器不再使用该方法,而是使用上述上面的方法,而edge浏览器反而需要使用该方法。
上一篇:js中获取dom元素大小
下一篇:js表单事件
js 指定滚动条滚动到指定位置,指定滚动条滚动高度
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M