<iframe id="frameContent" name="frameContent" onload="return IframeOnload('frameContent');" src="ชื่อ url iframe ของคุณ" class="adm_iframe" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" width="562px"></iframe>
<script type="text/javascript">
var isIE = (navigator.appName.indexOf("Microsoft")!=-1)? true:false;
function GetDocument(frameName)
{
if( isIE )
{
return document.frames[frameName].document;
}
else
{
return document.getElementById(frameName).contentDocument;
}
};
var tm_AutoHeightFrame = null;
function AutoHeightFrame(frameName)
{
AutoHeightFrame1(frameName);
if( tm_AutoHeightFrame == null )
{
tm_AutoHeightFrame = setInterval(function(){AutoHeightFrame1(frameName);}, 200);
}
};
function AutoHeightFrame1(frameName)
{
var frm = document.getElementById(frameName);
if( frm == null ) return;
var frameBody = GetDocument(frameName).body;
if( frameBody == null ) return;
var _height = frameBody.scrollHeight+10;
if( _height < 360 ) {_height=360;} //you can change 410 to your own value, this is min height for iframe.
frm.height = _height;
}
function IframeOnload(frameName)
{
AutoHeightFrame(frameName);
};
</script>
<script type="text/javascript">
var isIE = (navigator.appName.indexOf("Microsoft")!=-1)? true:false;
function GetDocument(frameName)
{
if( isIE )
{
return document.frames[frameName].document;
}
else
{
return document.getElementById(frameName).contentDocument;
}
};
var tm_AutoHeightFrame = null;
function AutoHeightFrame(frameName)
{
AutoHeightFrame1(frameName);
if( tm_AutoHeightFrame == null )
{
tm_AutoHeightFrame = setInterval(function(){AutoHeightFrame1(frameName);}, 200);
}
};
function AutoHeightFrame1(frameName)
{
var frm = document.getElementById(frameName);
if( frm == null ) return;
var frameBody = GetDocument(frameName).body;
if( frameBody == null ) return;
var _height = frameBody.scrollHeight+10;
if( _height < 360 ) {_height=360;} //you can change 410 to your own value, this is min height for iframe.
frm.height = _height;
}
function IframeOnload(frameName)
{
AutoHeightFrame(frameName);
};
</script>
Subscribe by Email
Follow Updates Articles from This Blog via Email
No Comments