Javascript examples for DOM Event:onwheel
When the user rolls the mouse wheel over a <div> element, change its font-size:
<!DOCTYPE html> <html> <head> <style> #myDIV {//from ww w . j ava 2 s . co m border: 1px solid black; } </style> </head> <body> <div id="myDIV"> This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. </div> <script> document.getElementById("myDIV").addEventListener("wheel", myFunction); function myFunction() { this.style.fontSize = "35px"; } </script> </body> </html>