108
rated 0 times
[
114]
[
6]
/ answers: 1 / hits: 104454
/ 15 Years ago, wed, march 24, 2010, 12:00:00
Here is my code:
function pauseSound() {
var pauseSound = document.getElementById(backgroundMusic);
pauseSound.pause();
}
I would like to add a keyboard shortcut to this code, how can I do this so that the function can also be executed when a button is clicked too?
Tried to add an else if statement but it doesn't work, any ideas?
function doc_keyUp(e) {
if (e.ctrlKey && e.keyCode == 88) {
pauseSound();
}
else if (e.ctrlKey && e.keyCode == 84) {
playSound();
}
}
More From » scripting