Answers for "windows scroll condition"

0

windows scroll condition

window.onscroll =  ()  =>{
    // called when the window is scrolled.
    if (window.scrollY >= 30) {

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

    } else {
        //your event
    }
}
Posted by: Guest on February-16-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language