我的代码:
import java.io.*;
public class compute_volume
{
public static void main(String args[])throws IOException{
InputStreamReader reader = new InputStreamReader(System.in);
BufferedReader input = new BufferedReader(reader);
boolean answer;
double radius,height;
final double pi = 3.14159;
do{System.out.println("Enter the radius,press enter and then enter the height");
String t = input.readLine();
radius = Integer.parseInt(t);
t = input.readLine();
height = Integer.parseInt(t);
System.out.println("The volume of a cylinder with radius " + radius + " and height " + height + " is " + (pi*pi*height) + "\n Thanks …Run Code Online (Sandbox Code Playgroud) 我的代码(全窗启动).
我的JS代码:
$(document).ready(function () {
$("#play_buttton").hover(
function () {
$('#play_button').css({ "height": "240px", "width": "250px" });
},
function () {
$('#play_button').css({ "height": "225px", "width": "220px" });
}
);
});
Run Code Online (Sandbox Code Playgroud)
我认为这段代码必须创造问题.
问题:当我将鼠标悬停在图像上时(#play_button),没有任何反应,它的高度和宽度不会改变.任何人都可以告诉我如何解决这个问题.
谢谢.
我正在尝试对子元素进行简单的onclick(没有jQuery):
document.getElementById('link').children.onclick = function(){
this.style.color="#ff0000";
}
Run Code Online (Sandbox Code Playgroud)
我希望它为每个单击的元素将颜色更改为红色.我认为这种方法可行,但不会.
我已经看到很多问题,所有问题都与背景页面到内容脚本有关。
我的扩展有一个选项页面和一个内容脚本。内容脚本处理存储功能(chrome.storage操作)。每当用户更改选项页面中的设置时,我想向内容脚本发送一条消息以存储新数据。
选项.js
var data = "abcd"; // let data
chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) {
chrome.tabs.sendMessage(tabs[0].id, "storeData:" + data, function(response){
console.log(response); // gives undefined :(
});
});
Run Code Online (Sandbox Code Playgroud)
内容脚本js
chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
// not working
});
Run Code Online (Sandbox Code Playgroud)
我试图得到这个问题,但无法理解为什么它给出编译时错误我的代码是:
#include<stdio.h>
static struct student
{
int a;
int b;
int c;
int d;
}s1={6,7,8,9},s2={4,3,2,1},s3;
void main()
{
s3=s1+s2;
clrscr();
printf("%d %d %d %d",s3.a,s3.b,s3.c,s3.d);
getch();
}
Run Code Online (Sandbox Code Playgroud) 我的代码是:
#include<stdio.h>
int main()
{
char c='8';
int d=8;
printf("%d %d %d",d,d+=c>='0'&&c<='9',c++);
return(0);
}
Run Code Online (Sandbox Code Playgroud)
这个问题的结果是:9 9 56.我无法理解这一点.请有人帮助我,请解释我的输出.谢谢.
javascript ×3
c ×2
css ×1
html ×1
java ×1
jquery ×1
jquery-hover ×1
onclick ×1
output ×1
request ×1