Изменение высоты iframe

29.09.2010
Файл с родительской формой и iframe:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function ResizeIF()  
{  
  var ifh = window.parent.document.getElementById('frame').height;  
  var bh = document.body.scrollHeight;  
  var dh = document.documentElement.scrollHeight;  

  if (bh > 0 && dh > 0)  
  {  
    if(bh != ifh)  
    {  
      window.parent.document.getElementById('frame').height = bh;  
    }  
    else  
    {  
      window.parent.document.getElementById('frame').height = dh;  
    }  
  }  
}

Категории: JavaScript
Яндекс.Метрика