jQuery events 11/12


#1



Some problems in this lesson:
1. The message shows "Did you call the .animate()function on your ("div")?". I don't see anything wrong with my code.
2. I don't understand what "parseInt" in the js file means.

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


Can someone explain please?


Replace this line with your code. 
$(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

There's some explanation on the old Codecademy forums. See here.


#3

And about your error,

You have those img quotes different. Change them to "" (on both)


#4

There are a couple of these in Codecademy tutorials. Really need to be fixed because it gets frustrating.