Created
October 1, 2011 09:50
-
-
Save shameerc/1255819 to your computer and use it in GitHub Desktop.
cross browser event listener for keyboard events
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
// cross browser event listener for keyboard events | |
if(window.addEventListener){ | |
window.addEventListener('keypress',moveBar,false); | |
if($.browser.webkit){ | |
window.addEventListener('keydown',moveBar,false); | |
} | |
} | |
else if(window.attachEvent){ | |
window.attachEvent('keypress',moveBar,false); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment