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

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -