chrome 浏览器中,通过document.documentElement.scrollTop获取页面滚过高度,通过document.documentElement.scrollHeight获取页面总高度,通过document.documentElement.clientHeight获取当前内容高度。通过给window对象设置scroll事件,触发回调函数:将进度条dom style属性中的width或height动态修改为(页面滚过高度 + 当前内容高度)/ 页面总高度

chrome 浏览器中,通过document.documentElement.scrollTop获取页面滚过高度,通过document.documentElement.scrollHeight获取页面总高度,通过document.documentElement.clientHeight获取当前内容高度。通过给window对象设置scroll事件,触发回调函数:将进度条dom style属性中的width或height动态修改为(页面滚过高度 + 当前内容高度)/ 页面总高度