Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Expandable iFrame depending on child content

Posted on 2006-07-02
3
Medium Priority
?
893 Views
Last Modified: 2008-01-09
Hi X-perts,

I am trying to find the best solution for an expandable iFrame, which height depends on the child's page height. The child page is from my site also. I am using currently this code:

<a href="page1.php" target="details">
<span id="visSpan">Wait</span>
<iframe id="details" name="details" width="495" frameborder="0" align="top" marginwidth="0" marginheight="0" scrolling="no" onload="visSpan.innerHTML=details.document.body.innerHTML" style="display:none"></iframe>

I am having problems with flash objects on the child page - see my post http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_21906072.html

Are there any better JScript solutions for the resizable iFrames? I believe, Zvonko has written a similar script, but I cannot find the complete code.

Thanks

-A-
0
Comment
Question by:andy7789
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 63

Accepted Solution

by:
Zvonko earned 2000 total points
ID: 17031054
How about this:

<script>
function reSize(theIframe){
  var fName = theIframe.name;
  window.frames[fName].frameElement.style.height=window.frames[fName].document.body.scrollHeight;
}
</script>
<body>
<a href="page1.htm" target="details">Page One</a><br>
<iframe id="details" name="details" width="495" frameborder="0" align="top" marginwidth="0" marginheight="0" scrolling="no" onload="reSize(this)" ></iframe>

</body>

0
 

Author Comment

by:andy7789
ID: 17034492
Works just as good as it could be! Thanks!
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 17035996
You are welcome.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
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…

715 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