Solved

Expaning iFrame

Posted on 2011-03-08
3
313 Views
Last Modified: 2012-08-14
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
Comment
Question by:iamteejay
3 Comments
 
LVL 15

Accepted Solution

by:
pateljitu earned 500 total points
ID: 35083386
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
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 35868888
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question