범위 문제는 함수 문이 항상 현재 컨텍스트의 맨 위에 올랐다 고 생각합니다. 그럼 왜 'hideNav()'가 다음에서 정의되지 않습니까?자바에서 setTimeout으로 범위 문제가 발생했습니다.
var t;
function showNav(bflag){
clearTimeout(t);
if(bflag===true){
$("#tS2").stop(false,false).animate({
'bottom':'0'
}, 1000);
}else{
t=setTimeout("hideNav()",1000);
}
}
function hideNav(){
$("#tS2").stop(true,false).animate({
'bottom':'-125px'
}, 1000);
}