8/11 bug fix please


#1

My code seems to be right and the sprite moves to the keys correctly yet when I press submit it takes me to the demo screen, I move the keys, it works perfectly when I click the sprite and then when I go back to editor to finish the exercise it prompts me this error message

"Oops, try again. Make sure to press 'left', 'up', 'right', or 'down' to make your character move!"

here is my code. lmk if something is wrong. thank you

`$(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');
break;

		// Right Arrow Pressed
		case 39:
			 $('img').animate({left: "+=10px"}, 'fast');              break;
		// Down Arrow Pressed
		case 40:
			 $('img').animate({top: "+=10px"}, 'fast');
			break;
	}
});

});`


#2
$(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');
				break;
				
			// Right Arrow Pressed
			case 39:
				 $('img').animate({left: "+=10px"}, 'fast');              break;
			// Down Arrow Pressed
			case 40:
				 $('img').animate({top: "+=10px"}, 'fast');
				break;
		}
	});
});

#3

Hi Galakseas,

8/11 takes me to this exercise: https://www.codecademy.com/en/courses/web-beginner-en-JwhI1/1/4, which asks for code different than what you have. Would you mind posting a link to the exercise you're on? (unless it really is 8/11, in which case just confirm that it is please)