[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 321
  • Last Modified:

Expaning iFrame

Hi

I have an ASP driven web site where we have a nested iFrame, nested within a div tag with an height set at auto, that is home to all the sub pages. Having a fixed height forces us to see two scroll bars on a page on the longer pages that are dropped.

I see several solutions from Joomla and PHP situation, but non that work for me in this environment. Thank you for you time.
<iframe src="dashboard.asp" name="pagecontent" width="780" height="100%" frameborder="0" scrolling="no">

Open in new window

0
iamteejay
Asked:
iamteejay
1 Solution
 
pateljituCommented:
You could run an auto re-size script for IFRAME using javascript.
<script type="text/javascript">
function autoResize(id){
	var newheight;
	var iframe = document.getElementById(id);

	try{
          var innerDoc = (iframe.contentDocument) ? iframe.contentDocument : iframe.contentWindow.document;
          if (innerDoc.body.offsetHeight){ //ns6 syntax
             iframe.height = innerDoc.body.offsetHeight + 32; //Extra height FireFox
          }
          else if (iframe.Document && iframe.Document.body.scrollHeight){ //ie5+ syntax
             iframe.height = iframe.Document.body.scrollHeight;
          }
        }
        catch(err){
          alert(err.message);
        }

}
</script>
<div>
	<iframe id="some_frame" src="dashboard.asp" width="780" height="100%" scrolling="no"
		onload="autoResize('some_frame');" frameborder="0">
	</iframe>
</div>

Open in new window

0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now