我对编程相当陌生,并且很难弄清楚为什么它不起作用。脚本中的两个代码都能正常工作,但是当放在一起时,只有最后一个代码可以工作。
代码:
var video1 = document.getElementById("clap-test");
document.onkeypress = function(e) {
if ((e || window.event).keyCode == "83") {
video1.currentTime = 0, video1.play();
}
};
var video2 = document.getElementById("chord-1");
document.onkeypress = function(e) {
if ((e || window.event).keyCode == "65") {
video2.currentTime = 0, video2.play();
}
};
#backplate {
position: absolute;
top: 0;
left: 0;
min-height: 100%;
min-width: 100%;
z-index: -4;
}
#twinkle {
position: absolute;
top: 0;
left: 0;
min-height: 100%;
min-width: 100%;
z-index: -3;
mix-blend-mode: screen
}
#skel-walk {
position: absolute;
top: 0;
left: 0;
min-height: 100%;
min-width: 100%;
z-index: -1;
mix-blend-mode: screen;
}
#clap-test {
position: absolute;
top: 0;
left: 0;
min-height: 100%;
min-width: 100%;
z-index: 0;
mix-blend-mode: screen;
}
#chord-1 {
position: absolute;
top: 0;
left: 0;
min-height: 100%;
min-width: 100%;
z-index: -2;
mix-blend-mode: screen;
}
Video not supported
Video not supported
Video not supported
Video not supported
2017-08-07
ThomTTP
+0
@rabbit guy嗨对不起,我的错误,我认为它是Java的一部分,生病删除标签 - 新的所有这一切!你有什么建议可能是什么问题? –