-2

I need Javascript to fix the iframe height dynamically according to available height in the browser ?

Shan
  • 53
  • 1
  • 3
  • i tried function resizer() { var _iframe = document.getElementById('frmContent'); var _divIframe = document.getElementById('iframe'); _iframe.height = window.innerHeight - 135; _iframe.width = window.innerWidth - 10; } – Shan Nov 20 '12 at 16:56
  • but this is working in chrome,IE 9 not in IE 8. – Shan Nov 20 '12 at 16:58
  • there this window height is not coming – Shan Nov 20 '12 at 16:58
  • you can also take a look at this: http://stackoverflow.com/questions/3979000/iframe-and-conflicting-absolute-positions – Van Coding Nov 20 '12 at 17:44

1 Answers1

0

Is this what you are looking for?

$(function(){    
    //sets the height of the iframe to the height of the browser viewport
    $("#idOfIframe").height($(window).height());
}
davehale23
  • 4,374
  • 2
  • 27
  • 40