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");
여기 코드에서 에러나오느데요 스타일을 못찾는다고 하네욤~~ 스타일을 지워도 안되서 올려보와욤^^
도와주실분^^
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개
sjsjin
13년 전
위 코드를 왜 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.........
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.........
게시판 목록
팁게시판
디자인과 관련된 유용한 정보를 공유하세요.
질문은 상단의 QA에서 해주시기 바랍니다.
질문은 상단의 QA에서 해주시기 바랍니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 6077 | 9년 전 | 150 | ||
| 6076 |
PlayPixel
|
9년 전 | 141 | |
| 6075 | 9년 전 | 158 | ||
| 6074 | 9년 전 | 214 | ||
| 6073 |
|
9년 전 | 177 | |
| 6072 |
|
9년 전 | 319 | |
| 6071 | 9년 전 | 221 | ||
| 6070 |
|
9년 전 | 256 | |
| 6069 | 9년 전 | 233 | ||
| 6068 |
|
9년 전 | 185 | |
| 6067 | 9년 전 | 193 | ||
| 6066 |
|
9년 전 | 311 | |
| 6065 |
PASKRAN
|
9년 전 | 200 | |
| 6064 | 9년 전 | 230 | ||
| 6063 |
kiplayer
|
9년 전 | 332 | |
| 6062 |
|
9년 전 | 271 | |
| 6061 | 9년 전 | 208 | ||
| 6060 |
|
9년 전 | 261 | |
| 6059 |
|
9년 전 | 206 | |
| 6058 |
|
9년 전 | 199 | |
| 6057 | 9년 전 | 248 | ||
| 6056 |
|
9년 전 | 198 | |
| 6055 |
|
9년 전 | 245 | |
| 6054 |
|
9년 전 | 225 | |
| 6053 |
snshero
|
9년 전 | 570 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기