Quotes help make search much faster. Example: "Practice Makes Perfect"

Monday, November 26, 2012

Codecademy: "Filling Out the Cases"


//sample solution to script.js

$(document).ready(function() {
    $(document).keydown(function(key) {
        switch(parseInt(key.which,10)) {
case 65://left
$('img').animate({left: "-=10px"}, 'fast');
break;
case 83://down
$('img').animate({top: "+=10px"}, 'fast');
break;
case 87://up
$('img').animate({top: "-=10px"}, 'fast');
break;
case 68:
$('img').animate({left: "+=10px"}, 'fast');
break;
default:
break;
}
});
});

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts