Created
April 12, 2011 23:11
-
-
Save mikel/916650 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Fires up Asteroids through pressing Ctrl-A | |
// | |
var isCtrl = false; | |
$(document).keyup(function (e) { | |
if(e.which == 17) isCtrl=false; | |
}).keydown(function (e) { | |
if(e.which == 17) isCtrl=true; | |
if(e.which == 65 && isCtrl == true) { | |
if($('script#Asteroids').size()==0){ | |
var s = document.createElement('script');s.type='text/javascript'; | |
$(s).attr('id', 'Asteroids'); | |
document.body.appendChild(s); | |
s.src='http://erkie.github.com/asteroids.min.js'; | |
return false; | |
} | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment