Solved

Expaning iFrame

Posted on 2011-03-08
3
309 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 142

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This article discusses four methods for overlaying images in a container on a web page
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 basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

746 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now