Filling out classes - 11


#1

Hi!
I have the following code. Mario moves to the left, right and downwards, but he doesn't move upwards... What is wrong?
Thanks.

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

11. Filling Out the Cases
#2

missing the p for px


#3

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