Prince Singh
6
Q:

mouse scroll event html


 window.onscroll = function() {myFunction()};

function myFunction() {

    if (document.body.scrollTop > 50 || document.documentElement.scrollTop > 50) {
    document.getElementById("myP").className = "test";
  } else {
    document.getElementById("myP").className = "";

    }
}
 
0
element.onscroll = function() {
  // Code here
}
0

New to Communities?

Join the community