Filling Out the Cases - Can´t move the Image


#1


What´s wrong here?
In the Browser it says:
Please press the required key down on [object Object].

When I hit the cursor-buttons nothing happens.
I always get the folling Allert:
Oops, try again. Please follow the instructions on the Full Preview page to test your code.


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


$(document).ready(function() {
    $(document).keydown(function(key) {
        switch(parseInt(key.which,10)) {
			// Left arrow key pressed
			case 37:
				$('img').animate({left: "-=10px"}, 'fast');
				break;
			// Up Arrow Pressed
			case 38:
			    $('img').animate({top: "-=10px"}, 'fast');
				// Put our code here
				break;
			// Right Arrow Pressed
			case 39:
			    $('img').animate({left: "+=10px"}, 'fast');
				// Put our code here
				break;
			// Down Arrow Pressed
			case 40:
			    $('img').animate({top: "+=10px"}, 'fast');
				// Put our code here
				break;
		}
	});
});


#2

Click anywhere on the screen then move mario around by moving your arrow keys, after doing that you should pass :slight_smile:


#3

Thank you. it works.


#4