11 Filling Out the Cases


#1

Filling Out the Cases bug.
I correctly wrote the code. but Mario is moving left. right, down and up he's not moving

$(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

your code should work.
try after refreshig your browser

can i see your css ?


#3

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