You should be able to do this using only CSS, without the need for javascript. The following works for me in IE6 +, Google Chrome, and Safari:
<style type="text/css"> body { margin: 0; overflow: hidden; } #iframe1 { position:absolute; left: 0px; width: 100%; top: 0px; height: 100%; } </style> <iframe id="iframe1" name="iframe1" frameborder="0" src="theSiteToShow.html"></iframe>
Frame fields must be set in theSiteToShow.html body.
UPDATE
After your comment, I used the following test page:
<html> <head> <style type="text/css"> body { margin: 0; overflow: hidden; } #iframe1 { position:absolute; left: 0px; width: 100%; top: 0px; height: 100%; } </style> </head> <body> <iframe id="iframe1" src="http://stackoverflow.com" frameborder="0"></iframe> </body> </html>
Tested in IE6 +, Chrome, Safari and Firefox, it works great and fills the whole window.
Andy e
source share