8 .keydown() event


#1


https://www.codecademy.com/courses/web-beginner-en-JwhI1/1/4?curriculum_id=50a3fad8c7a770b5fd0007a1#


I have all of the code correctly but any key I click on doesn't do anything. It gives me the error: "Oops, try again. Please follow the instructions on the Full Preview page to test your code."


Replace this line with your code. 
Here is what I have

$(document).ready(function() {
    $(document).keydown(function() {
        $('div').animate({left:'+=10px'},500);
    });
});


#3

How so? 'div' does not have a keydown binding, only the document object does as I understand it. Your advice is incorrect, I'm afraid.


#4

There is a time lag in the full screen view. Give each step at least two seconds of delay before proceeding.

  1. Submit
  2. Click inside the preview window.
  3. Press a key, and pause.
  4. Press any key again to watch your effect.
  5. Return to editor.

#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.