Ask:
There is a page niu.html code as follows
<iframe src=http://www.iiwnet.com/about.html ></iframe>
The height of the page is passed through the body of the about.html page, but I am now invoking something from a different website. Can't
Get his height on the page that was called: Do I have a way to implement the IFRAME automatically adjust the height in the niu.html page?
For:
Of course you can.
Important NOTE: src= you must fill in the Web address, must and this page in the same site, otherwise, will be wrong, said "Access Denied!" ”
Before I have encountered this problem, in order to get the answer to the online search, found that many people have encountered such problems, and now the solution to share
It's super simple!
1, create a iframe.js file, and then enter the following code (only two lines oh)
Parent.document.all ("Frame ID name"). style.height=document.body.scrollheight;//Get Height
Parent.document.all ("Frame ID name"). style.width=document.body.scrollwidth;//Get width
The frame ID Name here is the ID of the IFRAME, such as:
</ iframe></p>
2. Add each of the included documents to your website
3, OK, call it off!
I passed the test under WinXP and IE6. It's simple!
iframe Frame self-adapting height