Iframe with auto height that will work in all browser
Javascript Code:
<script type="text/javascript">
function calcHeight()
{
//find the height of the internal page
var F = document.getElementById("blockrandom");
if(F.contentDocument) {
var the_height = F.contentDocument.documentElement.scrollHeight+30;
}else {
var the_height= F.contentWindow.document.body.scrollHeight; //IE6, IE7 and Chrome
}
alert(the_height);
//change the height of the iframe
document.getElementById('blockrandom').height= the_height;
}
</script>
Html Code:
<iframe
id="blockrandom"
name="iframe"
onLoad="calcHeight();"
src="<?php echo $this->escape($this->wrapper->url); ?>"
width="<?php echo $this->escape($this->params->get('width')); ?>" //or put 100%
scrolling="NO"
>
</iframe>
Where do you place the iframe URL
ReplyDelete