테스트 사이트 - 개발 중인 베타 버전입니다

자바스크립트 오류인데요^^ 도와주실분^^

· 13년 전 · 756 · 1
function moveLayer(strlayer,width,height,evt) {

var theObj;

if (navigator.appName == 'Netscape' && document.layers != null)
theObj = eval("document.layers['" + strlayer + "']");
else if (document.all != null) //IE
theObj = eval("document.all['" + strlayer + "'].style");


var windowWidth = document.body.scrollWidth;
if(theObj) {

if (windowWidth<1180){
theObj.pixelLeft = evt.x+5-200;
theObj.pixelTop = evt.y+5+document.body.scrollTop;
}else{
theObj.pixelLeft = evt.x+5-200;
theObj.pixelTop = evt.y+5+document.body.scrollTop;
}
}
}


>>

theObj = eval("document.all['" + strlayer + "'].style");

여기 코드에서 에러나오느데요 스타일을 못찾는다고 하네욤~~ 스타일을 지워도 안되서 올려보와욤^^

도와주실분^^

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

댓글 1개

위 코드를 왜 eval 로 처리하는지 모르겠군요. 불필요한데..
if(document.getElementById)
theObs = document.getElementById(strlayer); // DOM
else if (document.layers)
theObj = document.layers[strlayer]; // NN
else if (document.alll) // IE < IE7, 스트릿모드 생략
theObj = document.all[strlayer];

// 스타일처리시
theObj.style.........

게시글 목록

번호 제목
12487
12486
380
12484
12483
376
12482
12481
12479
12478
12477
12476
12475
12474
12473
12472
12471
12470
12469
371
12468
12467
12466
12465
12464