11. Filling Out the Cases



My code should work. But I get error message. Should I just disregard the error message and jump to next lesson?

Tried already refreshing page and cleaning history.

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


what's the error message?

try it

  • click on the Save & Submit code button
  • click on the page
  • move the object
  • now click on the Back to Editor button


Code works just fine. After testing it, when I go back to editor, it shows this

Error message:

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

ps. attached is screenshot as well


so what do you think according to error message?

what lesson wants?

just think about it.I think you can do it :slight_smile:


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