jQuery 11, Filling out the Cases



If I wrap the $(“img”) in double quotes, I get the error message “Oops, try again. Did you call the .animate() function on your $(‘img’) for each of the three additional cases?”. However, if I change the double quotes to single quotes like so, $(‘img’), I pass the exercise. In both cases, the Mario sprite moves correctly

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


" " is absolutely fine.but i think here In codecademy system checker doesn’t allow it.


Click where it says filling out the cases and click on the next exercise! YAY!!!


I would have to have passed that exercise (which I did by changing to their expectations) in order for this to be useful.


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