You can use this javascript function to resize the height of your iframe depending on the size of your parent page.
JAVASCRIPT:
-
<script language="JavaScript">
-
function iFrameHeight() {
-
if(document.getElementById && !(document.all)) {
-
h = document.getElementById('main').contentDocument.body.scrollHeight;
-
document.getElementById('main').style.height = h + 100;
-
}
-
else if(document.all) {
-
h = document.frames('main').document.body.scrollHeight;
-
document.all.main.style.height = h + 100;
-
}
-
}
3 Responses
hadi
February 16th, 2008 at 2:53 pm
1please explain it, where should i put it? in mail page or in frame content page?
aRo`
February 17th, 2008 at 2:35 pm
2You should put this code in the main page.
If you need some help, just let me know!
Mattias Jacobsson
June 9th, 2008 at 10:58 am
3How do I set the height and widt? My code:
function iFrameHeight() {
if(document.getElementById && !(document.all)) {
h = document.getElementById(’main’).contentDocument.body.scrollHeight;
document.getElementById(’main’).style.height = h + 100;
}
else if(document.all) {
h = document.frames(’main’).document.body.scrollHeight;
document.all.main.style.height = h + 100;
}
}
RSS feed for comments on this post · TrackBack URI
Leave a reply
Who is aRo` ?
I'm an e-commerce consultant trapped in a developpers mindset.I work with:
Popular posts
Recent posts
Categories
Links
Software
Calendar
Archives
Mybloglog
Add me to skype