Why isnt this working?


#1


https://www.codecademy.com/courses/web-beginner-en-JwhI1/2/3?curriculum_id=50a3fad8c7a770b5fd0007a1


This keeps poping up and im not sure why? Oops, try again. Please follow the instructions on the Full Preview page to test your code.
I've tried on chrome and internet explorer and refreshing the page doesn't help


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

try this

  • Click on Save & Submit Code button
  • Click on the page
  • Follow the instruction next to Back to editor button

#3

i have tried your code and it works.

maybe try it in a different browser.


#4

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