11. Filling Out the Cases///


mario moves perfectly but it it tells me that there is error. can you help me please?

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


Change to double quotes like so: $("img")


i have replaced with $('img') with double quotes like $("img").. still its showing error.


Please paste in your code and error


you forgot one of these - }); at the end :smile:


refresh the page ,u need to click on mario image first then press the key its works on same code.


hey there!

i was stuck on this for ages as well, i have been looking through all the forums for a solution to this issue.

it appears that this lesson wants all of your selectors to look EXACTLY like this $('img')

once i removed all double quotes from my code it allowed me to move on.
hope this helps :grin: