Created
April 29, 2014 17:22
-
-
Save jedahan/11406679 to your computer and use it in GitHub Desktop.
3ds centric html
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="width=400"> | |
<style> | |
body{margin:0px;} | |
#topscreen{width:400px;height:220px;overflow:hidden;} | |
#bottomscreen{width:320px;height:212px;overflow:hidden;margin:0 auto;} | |
</style> | |
<script type="text/javascript"> | |
window.setInterval(function () { | |
window.scrollTo(40, 220); | |
}, 50); | |
document.onkeydown = keydetect; | |
function keydetect(e) { | |
if (e) { | |
var whichone = (e.which); | |
} | |
if (!e) { | |
e = event | |
var whichone = (e.keyCode); | |
} | |
if (whichone == 13) { | |
alert("You pressed the A button!"); | |
$('.console').text('A BUTTON, BABY'); | |
} | |
if (whichone == 37) { | |
alert("You pressed left on the D-pad!"); | |
} | |
if (whichone == 38) { | |
alert("You pressed up on the D-pad!!"); | |
} | |
if (whichone == 39) { | |
alert("You pressed right on the D-pad!"); | |
} | |
if (whichone == 40) { | |
alert("You pressed down on the D-pad!"); | |
} | |
} | |
</script> | |
</head> | |
<body> | |
<div id="topscreen">Top Screen</div> | |
<div id="bottomscreen">Bottom Screen</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment