How to increase the size of an iframe based on its content

Posted on 2003-11-18
Last Modified: 2008-02-01
Hii Friends,
i want to increase the size of iframe based on its source provided in the src attribute.
i have code like this
<td>page Header</td></tr>
<tr><td><ifame src="" >
<td>page Header</td></tr>

when i access this kind of page i got scrollbar in iframe .
but i don't want this scrollbar and if hardcode the width and height of iframe like the code given below

<td>page Header</td></tr>
<tr><td><ifame src=""  width="300" height="1000">
<td>page Header</td></tr>

then some part of ifrmae remains blank i don't want this kind of behavior.
so my aim is to adjust the width and height of iframe to the src height and width how i can do this ..
thanks to all of u in advance.

Question by:happymanocha

Accepted Solution

apprenti earned 75 total points
ID: 9779639
This is the parent document:
<td>page Header</td></tr>
<tr><td><iframe id="miframe" src="tpage1.htm" ></iframe>
<td>page Header</td></tr>

This is a document in the iframe -- tpage1.htm

<html><body id="b1">
hello<br />
hello<br />
// alert(f)
// -->

You would need to style up the iframe etc and make f=f+40 or whatever

Expert Comment

ID: 9783398
 Maybe I'm just trying to get a cheap way out of this - but if you're upset about scrollbars showing up in your iframe, you could always take the overflow off with CSS.

    <style type= text/css>
       body {overflow: hidden}

  Putting this code in the document within the iframe will eliminate scrollbars - but it will also cut off anything that would normally be viewed through scrolling.  I'm not really sure if that will help you or not....

LVL 16

Expert Comment

ID: 10383002
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: apprenti {http:#9779639}

Please leave any comments here within the next four days.

EE Cleanup Volunteer

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Debugging step-by-step Jquery/Javascript 6 57
rhino JavaScript import, load 25 66
Initialize SharePoint Online List Values in Quick Edit 7 21
Form with Modals 16 42
In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
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…

911 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

20 Experts available now in Live!

Get 1:1 Help Now