Why isnt this working?



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');
			// 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');


try this

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


i have tried your code and it works.

maybe try it in a different browser.


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