Created
April 26, 2014 17:54
-
-
Save sircommitsalot/11326544 to your computer and use it in GitHub Desktop.
rotate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function checkKey(e) { | |
e = e || window.event; | |
if (rotation >= 360) { | |
rotation = Math.abs(rotation % 360); | |
} else if (rotation <= 0) { | |
rotation += 360; | |
} | |
if (e.keyCode == '37') { | |
rotation -= 5; | |
follower[0].style.webkitTransform = 'rotate(' + rotation + 'deg)'; | |
} else if (e.keyCode == '39') { | |
rotation += 5; | |
follower[0].style.webkitTransform = 'rotate(' + rotation + 'deg)'; | |
} else if (e.keyCode == '38') { | |
// up arrow | |
} else if (e.keyCode == '40') { | |
// down arrow | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment