<script>
function Test(fn,delay){
let timer = null;
return function () {
if(timer){
clearTimeout(timer);
}
timer = setTimeout(fn,delay);
}
}
window.onscroll=Test(scrollHandle,200);
function scrollHandle(){
let scrollTop = document.documentElement.scrollTop;
console.log(scrollTop);
}
</script>