Hi All,
I have an asp page having an iframe. I need to set automatic height to iframe. I found an article on http://stackoverflow.com/questions/91721/iframe-sizing but it could not solve my problem. My iframe is
<iframe id="content" src=http://www.bc.com.au/news_manager/templates/?a=<%=request.QueryString("a")%>&z=<%=request.QueryString("z")%> width="908px" height="1000px" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" style="margin-left:auto; margin-right:auto;" ></iframe>
and code on asp page is:
<script type="text/javascript">
window.onresize=resizeContentFrame;
resizeContentFrame();
function resizeContentFrame(){
setFrameHeight(documenent.getElementById('content'));
}
function setFrameHeight(f){
if(isDefined(f)){
alert('executing');
var h=document.documentElement.scrollHeight;
h-=(HEADER_HEIGHT+CONTENT_PADDING+5);
f.style.height=h+'px';
}
}
</script>
In case i dont give a fixed height in iframe it simply cuts the iframe content.
what wrong i am doing while the above script is marked as answer ??
Help...