javascript - ReferenceError: event is not defined on keyup event in firefox -


Why does this code not work in Firefox? I want to create a switch image in the gallery on the keypot event. I had read similar problems and answers, but nobody helped me JQuery 1.4.4 My code:

  $ ('body'). Live ('keyup', function (e) {if (e.keycode == 37) {$ ('. DaPrev'). Click ()} and if (e.keycode ==39) {$ ('. DaNext When I press the console:  
  Reference error: Event is not defined    I have not named any event in your code, and it looks valid. However, there are some things you can try: 

  • Use .delegate
  • Try a new version of jQuery and switch.

.delegate:

$ Representative (selector, event type, handler);

ie.

  $ Representative ("div", "keyup", function (e) {...});  

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -