📄 cspractise.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body onload=joe()>
<div id=food style="position:absolute;width:30;height:30;background-color:red;cursor:hand" onclick=win()><img name=pic1 src="arafat.bmp" style="position:absolute"><img name=pic2 src="arafat2.bmp" style="position:absolute"></div>
<div id=score style="position:absolute;width:30;height:30;background-color:green;z-index:-19">you score is 0</div>
<div id=shetach style="position:absolute;width:600;height:600;background-color:black;z-index:-20">you score is 0</div>
<script>
var time=30
var level=1000
var x=0
var levelis=1
pic1.style.display=""
pic2.style.display="none"
function joe()
{
food.style.display=""
randomNumLeft=(Math.random()*599)+1
roundNumLeft=Math.round(randomNumLeft)
food.style.left=roundNumLeft
randomNumTop=(Math.random()*599)+1
roundNumTop=Math.round(randomNumTop)
food.style.top=roundNumTop
if(time==0)
{
if(x>25)
{
pic2.style.display=""
pic1.style.display="none"
levelis++
alert("now its time for level "+levelis+" for experts")
time=30
x=0
levelTemp=level-300
level=levelTemp
levelis++
clearInterval(baby)
baby=setInterval('joe()', level)
pic1.style.display=""
pic2.style.display="none"
}
else if(x>10 && x<30)
{
pic2.style.display=""
pic1.style.display="none"
levelis++
alert("now its time for level "+levelis)
time=30
x=0
levelTemp=level-100
level=levelTemp
levelis++
clearInterval(baby)
baby=setInterval('joe()', level)
pic1.style.display=""
pic2.style.display="none"
}
else
{
pic2.style.display=""
pic1.style.display="none"
alert("try again")
time=30
x=0
pic1.style.display=""
pic2.style.display="none"
}
}
}
function timing()
{
time--
window.status=time
}
baby=setInterval('joe()', level)
baby1=setInterval('timing()', 1000)
function win()
{
x++
score.innerText="your score is "+x
}
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -