3Dstudy/js/script.js

33 lines
902 B
JavaScript
Raw Normal View History

$(document).ready(function() {
console.log("ready");
$(document).on('keydown', function(e){
if(e.which == 37){
$("#char-container").css({
'left': '-=2rem',
})
2017-12-12 15:28:23 +01:00
$("#char-pants-left").css({
'animation-name': 'animation-move-left',
'animation-duration': '0.2s',
'animation-name': '',
'animation-duration': '',
})
2017-12-12 15:28:23 +01:00
}
if(e.which == 38){
$("#char-container").css({
'top': '-=2rem',
})
}
if(e.which == 39){
$("#char-container").css({
'left': '+=2rem',
})
$("#char-pants-right").css({
})
}
if(e.which == 40){
$("#char-container").css({
'top': '+=2rem',
})
}
})
});