Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    JavaScript


Iframe Resize

I need to adjust my IFrame Height based on srource page height (src) given for that IFrame.
I am getting it for the pages calling in the same domain like src='test.html', but I am not getting it when calling pages from other domains like src=''.

My Page Looks like this:

<iframe src="" name="NAME" scrolling="no" width="100%" frameborder="0" ></iframe>

It would be helpful if anyone suggest me a solution.

View 2 Replies (Posted: Aug 30, 2006, 05:54)

Sponsored Links:

Related Forum Messages For JavaScript category:
Use History To Resize An Iframe When A Submit Button Is Clicked Inside The Iframe
Im trying to use javascript history to resize an iframe when a submit button is clicked inside the iframe.

This is what i found so far.


Us this with iframe:



But im not really sure on how to apply this to my iframe, and i know that the resize part also needs to be edited, but what is missing?

Posted: 10-07-2011, 10:16 AM

View 1 Replies!   View Related
Resize The Height Of Iframe Dynamically On The Content Of The IFrame's Src?
I want to resize the height of Iframe dynamically on the content of the IFrame's src URL and the this src is coming through Webservice method.

Posted: Sep 16 11 at 7:28

View 1 Replies!   View Related
Resize Iframe Depending On Height Of Iframe Contents
Is there a way to resize an iframe dynamically so that you never get the scroll bar and essentially hide that there is an iframe? Better integration really.Basically I want to iframe a forum into my site so that the design down the sides and top which my friend does using iweb are not messed with.We have a central area which can be longer or shorter depending on the forum.

Posted: 08-02-2009, 10:05 PM

View 3 Replies!   View Related
How To Resize Iframe From Page In Iframe
I have a web page which will display another web page in an iframe. But the content inside the iframe may change while the user interacts with it so I need to be able to resize the iframe height from code on the page inside the iframe. Any tips on how I can do that? I am using php and javascript.

Posted: 03-18-2011, 08:48 AM

View 1 Replies!   View Related
Get The IFrame To Resize To The Content?
I've been able to get the iFrame to resize to the content - see this link - it's pretty simple. My only problem, is if the user clicks a link so that another page is displayed, the iFrame doesn't resize. It will only resize when the parent page is reloaded. So, not sure what to do about that.

(I do work with someone who writes Javascript and PHP, so they would know how to implement it if I found a solution).

Posted: May 21st, 2009

View 7 Replies!   View Related
Resize The Iframe Automatically
Is there any way to resize the iframe automatically, so that it could obtain the original height and width of the page which is embedded in that iframe? I actually saw this function on PayPal but I don't remember its link.

Posted: Jan 25, 2011

View 1 Replies!   View Related
Way To Detect Iframe Resize
Is there a way to detect if content of my iframe has changed?

My workaround is I have a loop which constantly check for the height of the content it effective but not efficient is there another way of doing this?

Posted: Aug 17 09 at 8:59

View 2 Replies!   View Related
Dynamically Resize An Iframe?
I can see that this question has been asked several times, but none of the proposed solutions seem to work for the site I am building, so I am reopening the thread. I am attempting to size an iframe based on the height of it's content. Both the page that contains the iframe and it's source page exist on the same domain.[code]...

Posted: Mar 2 09 at 22:20

View 3 Replies!   View Related
JQuery :: Resize Iframe To Fit Contents?
i have an iframe on page to hold record editing form - the form presented in the frame needs to be different sizes depending on the form size i want the page called to resize the frame but, i can't figure out how to refer to it from the page loaded in the iframe parent().$("#myiframe").height( $("#formcontentwrapper").height() ) ;

Posted: 22-May-2009

View 1 Replies!   View Related
Resize IFrame To Content Inserted By JS?
I am using a WYSIWYG web editor (Serif WebPlus X4; for a whole range of reasons - please don't turn this thread into a discussion of the pros and cons of WYSIWYG! ). It has a tool to create a site search facility, whereby you add a text box to accept the search terms, and specify an iFrame in which the results appear. The source of the iFrame is not specified as a page, but rather the content is generated and inserted by the search JavaScript that runs when the user searches the page.

I really don't want the results to be in an iFrame, because I think it looks a mess when the page and the iFrame both scroll. To avoid this, I'm trying to get the iFrame to resize to fit the results, so it won't need to scroll. (Of course, the alternative would be to change the JavaScript so the results are placed directly onto a page rather than in an iFrame, but because of the way the WYSIWYG editor works, that's less straightforward).

I've found many scripts online that would let me change the size of the iFrame based on its content, but they all assume that the content is coming from a file saved on the server, and work by checking the height of the file's content, and inserting that value as the height of the iFrame. Now, the problem is that when I use these scripts they cause the iFrame to become 0px high, I assume because the frame doesn't have a fixed source that can be measured, but rather gets its content fed in from the search JavaScript.

Can anyone help me figure out a way to resize the frame even though its content is dynamically generated as the page with the frame is loaded? I've copied below the search script and the html page with the iFrame that needs to resize. Ideally, whatever solution I use shouldn't involve editing the .js file I've attached, since this is generated automatically by the WYSIWYG program.


Posted: April 11th, 2010, 11:50 AM

View 1 Replies!   View Related
Resize Iframe On Mouse Focus?
I have two iframes next to each other at 50% width and am wondering if it's possible to resize one iframe to 80% when that iframe is moused over. Is it possible? If so, can someone post a small how-to on getting this to work?

Posted: Nov 25 09 at 9:34

View 1 Replies!   View Related
Jquery :: How To Detect Iframe Resize?
i have a page with a function to resize the height of iframe in this page as a height of content of iframe but whene the iframe has a toggle action the height change and the function dosn't detect the resize of the iframe. is there a way to detect if content of my iframe has change...

Posted: Jan 18 10 at 18:50

View 3 Replies!   View Related
Resize Iframe By Mouse Drag?
I have a page that consists of two iframes where they divide the page into two parts.

Is there a way to resize the division of the page using mouse drag? I would prefer a solution that does not require JQuery as we're not using it at the moment (We are using Microsoft AJAX library but I couldn't find a solution that leverages it).

Posted: Aug 26 10 at 2:20

View 1 Replies!   View Related
How To Dynamically Resize IFrame In Firefox
I used the solution stated on this page to resize the iFrame depending on the content:[URL].. And it works perfectly, except in Firefox. In Firefox, the other content is cut-off but once you keep on refreshing the page, the browser will slowly reveal the rest of the content. I saw someone replied that this is the solution to the problem:

Use jQuery to get the body height in
framed.html (FF issue, body kept
growing): var height =

However, I don't know where to put that line of code. Do I insert it somewhere within the 3 snippets of scripts on the original solution? If so, where do I put it?

Posted: Jan 25 at 3:27

View 2 Replies!   View Related
Resize The Iframe On Form Submit?
I have an iframe on my page and I added the following code to detect the iframe file height to avoid scrolling which is working fine.

<script type="text/javascript">
function setIframeHeight(iframeName) {
//var iframeWin = window.frames[iframeName];


There is a form in the iframe and it is coming from a third party web site which I have no access. My problem is when a client submits the search form in the iframe search results page is higher than the search main page and half of search results page is not shown. Is there a way to sense that the page in the iframe is changed and resize the iframe height accordingly?

Posted: 07-09-2010, 12:36 PM

View 2 Replies!   View Related
Resize Dynamically Built Iframe?
I am building iframes from database entries. Is it possible to resize them with an onclick event?

Posted: 10-19-2011, 11:24 PM

View 1 Replies!   View Related
Resize External Website In Iframe
I am trying to resize an external website in an iframe using javascript, but have not found code that works very well.

Posted: Nov 19th, 2008

View 5 Replies!   View Related
IE With Cross Domain Iframe Resize?
I'm using some javascript that senses the presence of an id on a page, creates an iframe containing cross domain content if it finds it and also resizes the iframe. It works great in FF, but IE stumbles if there's more than one iframe requested (especially IE6). If someone knows a better way to get IE to co-operate with this set up An acceptable alternative would be to only create one iframe at a time (which IE can handle), by using a link to trigger the iframe creation. I just can't figure out how to get that to work.The cross domain resizer uses the frame manager trick, the rest is homespun.

<script type="text/javascript" src="documents/FrameManager.js"></script>


Posted: 01-31-2010, 10:07 PM

View 5 Replies!   View Related
Iframe Resize To Remove Scrolls?
function resizeIframe(win)
var iwin;
while(win.parent != null && win.parent != win)


I want to write a code, which dynamically resize iframes to remove srollbars. I have iframe, I go to its parent..which might be another iframe inside some parrent.. I will loop till i resize all iframes.. someone got a fix?

Posted: 02-01-2010, 09:51 AM

View 3 Replies!   View Related
Resize Iframe Inside Containing Page?
I want to access the iframe my page is in and resize it. By the way I'm doing it in javascript. [code]...

Posted: Mar 24 10 at 9:21

View 2 Replies!   View Related
Resize An Iframe To Fit The Enclosing Panel?
I am using PrimeFaces 3 for this. I have an iframe element inside a p:panel which is enhanced with a p:resizable component. What I want is to automatically resize the iframe on load and on resize event so that it fits the available width and height of the panel.

Note that in this example, there is a p element with some text in it before the iframe. So the relative origin of the iframe isn't a constant.


My Javascript proficiency sucks but I am willing to learn. So I don't need more than a clue to get started.

Posted: Oct 6 11 at 16:26

View 1 Replies!   View Related
Firefox With IFrame Resize Script
here is my script that works just fine in IE. Onload I want the iframe to resize to the content loaded within it:


Error: document.getElementById("loadapi").contentWindow.document.body is undefined

Posted: Apr 23, 2010

View 5 Replies!   View Related
Resize Iframe Height Dynamically?
I'm having an issue resizing an iframe to fit the content located within the frame'd page. I used a suggestion I found here to resize the frame dynamically.

In my frame'd pages I have <body onload='parent.resizeIframe(getDocHeight())'>

function getDocHeight() {
var D = document;
return Math.max(


The function is getting called correctly by each frame'd page, but for some reason the 'newHeight' parameter being passed is keeping the largest height value. For example if I have 2 frame'd pages one with a scroll height of 300px and the other with 500px. When I first click my link to load the 300px page it works fine, but if I click the link to the 500px page and then try and come back to the 300px page, the value of 'newHeight' remains at 500.

Posted: May 11 11 at 3:18

View 3 Replies!   View Related
Resize Facebook Canvas App (iFrame) Correctly?
I need to adjust canvas size after updating content of a page. I can do it explicitly by

FB.Canvas.setSize({ width: 760, height: 1480 });

however, it doesn't work without parameters, i.e. .setSize().Also, I can adjust the height by


but only increasing - it doesn't reduce the height when content is reduced.The following lines do not work:

FB.Arbiter.inform("setSize", FB.Canvas._computeContentSize());

How can one make it working?facebook-api: what's Facebook Connect cross-domain receiver URL ?facebook-app: how can i change the height of a resizeable iframe application?Document height grows on resize when setting canvas dimensions dynamically How do you control the size of your Facebook Canvas apps?

Posted: Jan 14 at 21:02

View 6 Replies!   View Related
Copyright 2005-08, All rights reserved