📜  windows 滚动条件 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:38.595000             🧑  作者: Mango

代码示例1
window.onscroll =  ()  =>{
    // called when the window is scrolled.
    if (window.scrollY >= 30) {

        //your event
        console.log(window.scrollY);

    } else {
        //your event
    }
}