iFrame and Javascript?!?!
Posted: Tue Jun 24, 2008 7:26 pm
I'm trying to make and dynamic iframe wich is dynamic in height. I found a perfectly good script and it works like a charm outside cmsms, but inside... Nothing happens. Can anybody tell me why, and if it can be done, how???
The script:
And then the actually iframe:
The script:
Code: Select all
<__script__ language="JavaScript">
function iFrameHeight() {
if(document.getElementById && !(document.all)) {
h = document.getElementById('iframename').contentDocument.body.scrollHeight;
document.getElementById('iframename').style.height = h;
}
else if(document.all) {
h = document.frames('iframename').document.body.scrollHeight;
document.all.iframename.style.height = h;
}
}
</__script>
Code: Select all
<__iframe
onLoad="iFrameHeight();"
src="index.php"
scrolling="no"
scroll="no"
id="iframename"
marginwidth="0"
marginheight="0"
frameborder="0"
style="width:100%;">
</__iframe>