小编Chr*_*ris的帖子

如何向现有JavaScript函数添加JavaScript键盘快捷键?

这是我的代码:

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)

javascript keyboard scripting shortcut

45
推荐指数
4
解决办法
6万
查看次数

我应该在我的javadoc类和方法注释中写什么?

我目前已经创建了一个应用程序,需要一些帮助来编写我的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 javadoc

3
推荐指数
2
解决办法
3584
查看次数

我是否需要在java中使用javadoc每个方法或只是'main'方法?

Java示例方法:

//Stores the user input into an integer variable called 'choice'
int choice = keyboard.nextInt();
Run Code Online (Sandbox Code Playgroud)

我是否需要为这样的简单方法编写javadoc,或者我应该只记录任何程序的main方法,如果是这样,那么我应该为main方法编写什么样的东西?

谢谢,

克里斯.

java javadoc

-4
推荐指数
1
解决办法
5119
查看次数

标签 统计

java ×2

javadoc ×2

javascript ×1

keyboard ×1

scripting ×1

shortcut ×1