11/12: Filling Out the Cases


Hi, I completed the lesson, but my code still does not work. When I press the a, s, d and w keys nothing happens. Is this a bug or is there a way to improve the code? Thanks!

jQuery Events: 11/12: Filling Out the Cases

SyntaxError: Unexpected token ')'. Expected an identifier as property name.

$(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");


case 39:
$("img").animate({left:"+=10px", "fast");  //you didn't close }


case 40:
$("img").animate({top:"+=10px", "fast"); // same here


Oh ok, thanks for the help!

Really appreciate it!