getTime을 사용하여 이미지 갤러리의 타이머를 설정하려고합니다. imageWait()의 else 블록에서 경고를 추가하면이 함수는 완벽하게 작동하지만 경고 없이는 아무 일도 일어나지 않습니다. 어떤 아이디어?get time 함수를 사용하는 타이머 함수와 관련된 문제
milliseconds=null;
galleryLoop();
function galleryLoop(){
date=new Date();
startTime=date.getTime();
milliseconds=5000;
imageWait();
}
function imageWait(){
date=new Date();
currentTime=date.getTime();
if(startTime+milliseconds<=currentTime)
alert('made it')
else
imageWait();
}
어떻게 경고없이 같이 코드를 작성하지 않았나요? 중괄호는 어떻게됩니까? 변수가 선언되지 않은 이유는 무엇입니까? 그들은 지구 적 존재를 의미합니까? – elclanrs