Alex
0
Q:

jquery on wheel event

Syntax
Trigger the scroll event for the selected elements:
$(selector).scroll()

Attach a function to the scroll event:
$(selector).scroll(function)
2
$("#main-div" ).on( 'wheel', function() {
   alert("Hello! I am an alert box!!");
});
0

 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

New to Communities?

Join the community