📅  最后修改于: 2022-03-11 15:02:38.595000             🧑  作者: Mango
window.onscroll = () =>{
// called when the window is scrolled.
if (window.scrollY >= 30) {
//your event
console.log(window.scrollY);
} else {
//your event
}
}