0
버튼이 움직이지 않고 타이머가 작동하지 않으므로 코드에 문제가 있다는 것을 알지 못합니다.버튼과 시간이 작동하지 않음
버튼이 60 초가되기 전에 잡기가 까다롭기 때문에 전체 스크롤을 움직여야합니다.
코드로 시도했지만 버튼이 한 번만 움직입니다. 나는 항상 마우스의 화살표를 놓을 때 버튼이 항상 움직이기를 원합니다.
<SCRIPT>
var lose = 'YOU LOST'
var win = 'YOU WON'
function finish(message) {
clearTimeout(timer)
output.innerHTML = message
button1.style.display='none'
button2.style.display='none'
button3.style.display='none'
}
function moveme(obj) {
obj.style.pixelLeft += Math.random() * 250 - 150
obj.style.pixelTop += Math.random() * 250 - 150
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="goldenred" TEXT="black" onSelectStart="return false">
<CENTER>
<H1><b>Test</b></H1>
<P>If you can't click this button, you r lost!<BR>You got 60 sec.!</P>
<BR><BR>
<INPUT
TYPE=BUTTON
ID=button1
onClick="finish(win)"
onMouseOver="this.style.position='absolute'; moveme(this)"
VALUE="CLICK"
STYLE="display:none; top:300; left:200"
>
<INPUT
TYPE=BUTTON
ID=button2
onClick="finish(win)"
onMouseOver="button1.style.display=''; button3.style.display=''; this.style.position='absolute'; moveme(this); timer = setTimeout('finish(lose)', 60000)"
VALUE="CLICK"
STYLE="top:300; left:200"
>
<INPUT
TYPE=BUTTON
ID=button3
onClick="finish(win)"
onMouseOver="this.style.position='absolute'; moveme(this)"
VALUE="CLICK"
STYLE="display:none; top:300; left:200"
>
<SPAN ID="output"></SPAN>
60000ms로 시간이 변경되었습니다. 출력은 누군가가 버튼을 만지길 바라지 않는 메시지입니다 ... – user2713675