Javascript

[javascript] div, iframe 제어관련

청지인 2008. 1. 17. 10:32

만약 아래와 같이 div내부에 iframe이 덮어져있다면...
<div id="DIV_LayerAttributeView" name="DIV_LayerAttributeView" border="0" style="left:50; top:50; overflow:no; position:absolute; z-index:1; display:none" onMouseOut="">
  <iframe name="LayerAttributeView" id="LayerAttributeView" src="AttributeSearchListWait.jsp" width="180" height="200" frameborder="0" scrolling="no"></iframe>
 </div>

자바스크립트에서 제어를 하려면 아래와 같이 한다...
1. div 제어
     document.all.DIV_LayerAttributeView.style.left = 100;
     document.all.DIV_LayerAttributeView.style.top = 100;
     document.all.DIV_LayerAttributeView.style.display = "block";
2. iframe 제어
     document.LayerAttributeView.location.href = "test.jsp";
3. iframe의 사이즈를 자바스크립트 내에서 제어를 할땐 해당 iframe의 페이지에서
function FormResize(w,h) {
 try {
     self.resizeTo(w,h);
 }
 catch(e) {
     setTimeout('FormResize(w,h)',500);
 }
}
를 사용해여 제어를 한다.
별 방법을 써도 안되서 이 방법으로 그냥 사용했다..