11.Need some help with filling out the cases


#1

Oops, try again. Did you call the .animate() function on your $('img') for each of the three additional cases?

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


#2

The lesson goes funny when you use " double quotes in this lesson, please use single quotes around img


#3

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