javascript - jQuery: Why can't I access the event object in my scroll event? -
I want to use the original event item but the object return is undefined ..
$ (Window) .scroll (function) {warning (event.pageX);}); I'm just trying to make it work. The example is as basic as possible, so I can work on other events as well.
One thing to be careful about In some browsers (like IE and Chrome) event < / Code is not to be used as the name of a parameter (or a variable)> is already an object, and if you use it, then you already have an existing function Will be overwritten.
In this way, try changing your code:
$ (window) .scroll (function (ev) {warning (ev.pageX);}) ;
Comments
Post a Comment