Graph: navigation with keyboard

This commit is contained in:
randx 2012-05-31 23:30:54 +03:00
parent bcfdacf0d4
commit a719bfc931
4 changed files with 43 additions and 18 deletions

View file

@ -0,0 +1,9 @@
function initGraphNav() {
$("body").keydown(function(e) {
if(e.keyCode == 37) { // left
$(".graph svg").animate({ left: "+=400" });
} else if(e.keyCode == 39) { // right
$(".graph svg").animate({ left: "-=400" });
}
});
}