这是我的代码:
function pauseSound() {
var pauseSound = document.getElementById("backgroundMusic");
pauseSound.pause();
}
Run Code Online (Sandbox Code Playgroud)
我想为这段代码添加一个键盘快捷键,我怎么能这样做才能在单击按钮时执行该功能呢?
试图添加一个else if语句,但它不起作用,任何想法?
function doc_keyUp(e) {
if (e.ctrlKey && e.keyCode == 88) {
pauseSound();
}
else if (e.ctrlKey && e.keyCode == 84) {
playSound();
}
}
Run Code Online (Sandbox Code Playgroud) 我目前已经创建了一个应用程序,需要一些帮助来编写我的javadoc.
这是代码:
import java.lang.*;
import java.util.*;
import java.io.*;
import java.net.*;
/**
*@author Name HERE
*@version 1.0
* The Assignment2App public class represents a menu application that will form
* the base of the other source files which will be able to run within this program.
* Users will be able to run another source file within this pogram of which they choose
* by selecting a number specified by the output presented to them on the command window.
*/
public …Run Code Online (Sandbox Code Playgroud) Java示例方法:
//Stores the user input into an integer variable called 'choice'
int choice = keyboard.nextInt();
Run Code Online (Sandbox Code Playgroud)
我是否需要为这样的简单方法编写javadoc,或者我应该只记录任何程序的main方法,如果是这样,那么我应该为main方法编写什么样的东西?
谢谢,
克里斯.