Gary
asked on
iFrame Height
Is it possible to get the height of content in an iFrame i.e. the frame may be set to 300px high but the content is 600px 'high'. I want to know the 'height' of the content.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you can only get the scroll height if the page has loaded and it is from the same domain
ASKER
Ahh just discovered its setting the maximum height to the visible browser window height - can I get round this?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
<IFRAME name="i1" src="skdfjls" onload="document.getElemen tById('i1' ).height=t op.i1.docu ment.body. scrollHeig ht"></IFRA ME>
ASKER
The source is a page on my domain but may contain images from another domain.
And its setting the height to the height of the browser even when the content shouldnt make it that high
And its setting the height to the height of the browser even when the content shouldnt make it that high
ASKER
Excellent Zvonko, works like a charm :o)
if it not from your domain there is nothing you can do
Thanks :-)
ASKER
Thanks also to GwynforWeb :o)
Thx :-)
Thank you! My subscription to this site just paid off -- this solution solved my problem of having content dynamically loaded into an iframe, but couldn't figure out how to vertically stretch the iframe on content load.
Very nice...
Very nice...
ASKER
onload="this.style.height=
But sometimes it doesnt stretch large enough and other times I get lots of blank space at the bottom. What am I doing wrong.