<body>
<div>我会隐身</div>
<script>
const div=document.querySelector('div')
window.addEventListener('scroll',function () {
const n=document.documentElement.scrollTop
console.log(n);
if(n>=10){
div.style.display='block'
}else{
div.style.display='none'
}
})
</script>
</body>
</html>