Finding the size of a document in a IFrame

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
 
G

Guest

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
 
G

Guest

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
 
G

Guest

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.
 
G

Guest

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
 
M

Marina

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) :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top