How to call a function when the user uses the mouse wheel to scroll up/down in javascript
In HTML I have a table that is used as a grid. Now, I wan开发者_如何转开发t to attach an event to this table, that when a scroll up/down is triggered, then my ScrollUp/ScrollDown function is called.
You need some JS Framework to simply your development and not reinvent the wheel.
Here is examples for Mootools
- http://demos.mootools.net/CustomEvents
- http://demos111.mootools.net/Mousewheel
And here for JQuery
- http://api.jquery.com/scroll/
If your looking for a cross browser, JavaScript framework independent version then this will do what you need
http://adomas.org/javascript-mouse-wheel/
精彩评论