Go through these simple Steps:
step 1: Make Iframe with onload event
<IFRAME SRC="usagelogs/default.aspx" width="100%" height="200px" id="iframe1"
marginheight="0" frameborder="0" onLoad="autoResize('iframe1');"></iframe>
Step 2: Write autoResize(id) Function
<script language="JavaScript">
function autoResize(id){
var newheight;
var newwidth;
if(document.getElementById){
newheight=document.getElementById(id).contentWindow.document.body.scrollHeight;
newwidth=document.getElementById(id).contentWindow.document.body.scrollWidth;
}
document.getElementById(id).height= (newheight) + "px";
document.getElementById(id).width= (newwidth) + "px";
}
</script>
No comments:
Post a Comment