11/12 Can't figure out what I'm doing wrong


This is m code. The images is moving according to what it's supposed to be doing but an error tells me i'm not doing it right.

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


Hi Mwehrenberg,

Your code is fine :slightly_smiling: If it's not passing even after you click on the image and press an Arrow key, then try refreshing the page or switching browsers :slightly_smiling: