Last active
November 20, 2015 01:37
-
-
Save kbens/38e48ec14da4cb6f61e2 to your computer and use it in GitHub Desktop.
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
/* Toggle Login */ | |
function hideLogin(isHidden) { | |
if (isHidden) { | |
document.getElementById('loginbox').style.display = "none"; | |
} else { | |
document.getElementById('loginbox').style.display = "block"; | |
} | |
} | |
/* define a handler */ | |
function doc_keyUp(e) { | |
/* http://www.javascripter.net/faq/keycodes.htm */ | |
if (e.ctrlKey && e.keyCode == 32) {hideLogin(false);} /* Ctrl+Space */ | |
} | |
/* register the handler */ | |
document.addEventListener('keyup', doc_keyUp, false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment