general html question
-
Hi All, I am working on site where I am using iframes for dynamic html files. Each html file having own length and my iframe height is fixed. How can I set auto height for each page coming in iframe?
-
Hi All, I am working on site where I am using iframes for dynamic html files. Each html file having own length and my iframe height is fixed. How can I set auto height for each page coming in iframe?
Hi, Your question is nothing to do with ASP.NET. Better place of your question is Web Development Forum. Any way, you can achieve your requirment by using :
document.body.scrollHeight
anddocument.body.scrollWidth
For your reference, please have a look http://www.expertsforge.com/Web-Development/setting-iframe-heightscrolling-attribute-dynamically-using-javascript-161.asp[^] -
Hi All, I am working on site where I am using iframes for dynamic html files. Each html file having own length and my iframe height is fixed. How can I set auto height for each page coming in iframe?
Hi,you can refer to: <iframe id="treeFrame" name="treeFrame" frameborder="0" scrolling="0" width="100%" src="Tree.jsp"> <iframe id="contentFrame" name="contentFrame" frameborder="0" scrolling="0" width="100%" src="content.jsp" stype="height:expression(1);aho:expression(autoResize())"> <script type="text/javascript"> function autoResize() { try{ var hr = contentFrame.document.body.scrollHeight; var hl = treeFrame.document.body.scrollHeight; var height = Math.max(hr,hl); document.all["contentFrame"].style.height = height; document.all["treeFrame"].style.height = height; } catch(e){} } </script>
April Comm100 - Leading Live Chat Software Provider