Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
06-18-2009, 07:50 PM #1
- Join Date
- Feb 2005
- Bradford, UK
- Thanked 66 Times in 65 Posts
Cross browser, cross domain iframe resizing script
Is there any way to resize an iframe dynamically to the height of its content that works cross browser and works when the iframe content is on another domain than the main page (I have access to both pages, so code can be put in either)
Also, it must resize when links in the iframe are clicked (ie when a new page within the iframe is loaded)
06-18-2009, 10:09 PM #2
you could try getting the scroll height and width of your body element then resizing the content window.
Code:height = document.body.scrollHeight; width = document.body.scrollWidth; document.contentWindow.height = height; document.contentWindow.width = width;