Finding the size of a document in a IFrame

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I have a ASP.NET with an IFrame element that contains a another page. When this internal page loads I want the IFrame to increase in height so that all of the contents can be displayed. I've tried a number of ways, but none seem to work as they always miss the bottom 100 or so pixels. Is there any way to find the total height of the internal IFrame document? Can I get the IFrame to automatically resize itself?

Any help would be very much appreiciated as I need to find a soluton ASAP

Many Thanks

Michael
 
When you load the Page in IFrame, onload event of the page, you can set the height of the IFrame
setting window.top.frames("IFrameName").heigth should do

so basically, which ever page you are loading in the IFrame, it needs to be done
 
Hi

In order to set the height of the frame I need to find the height of the document that is loaded into the frame. How can I do this

Thank you for you response

Regards

Michael
 
instead try to find the height of the form (inside the doc) and set it
since the code to set the height of IFrame is inside the page itself, you can actually hardcode the height of the page

hth
Av.
 
I need to be able to do this as well.... however, I can't hardcode the size of anything... it all has to be dynamic. Is there a way to do that? Also, I may be taking the solution that you posted earlier too literally.... is there something I need to import to have 'window' recognized or is 'window' representative of something else? (I am new) :

window.top.frames("IFrameName").heigth
 
First off, you should look up the IFRAME element, which is completely
documented:
http://msdn.microsoft.com/library/d...hop/author/dhtml/reference/objects/iframe.asp

You will notice that there is contentWindow property, which gives you access
to the window being loaded. Once you have the window object, you can get at
anything in that window.

However, due to IE security precautions, unlses the page you are loading
happens to be in your application (or maybe it's the same domain), you will
not be able to access anything useful.

Tammy said:
I need to be able to do this as well.... however, I can't hardcode the
size of anything... it all has to be dynamic. Is there a way to do that?
Also, I may be taking the solution that you posted earlier too literally....
is there something I need to import to have 'window' recognized or is
'window' representative of something else? (I am new) :)
 
Back
Top