Developer forum

Forum » Templates » Iframe and full height

Iframe and full height


Reply
This page:

http://mediehusetherningfolkeblad.dk/Default.aspx?ID=356

has some content in an iframe - and I would like the iframe to fit the height of the content, and also that the page height is set by the height of the iframe. (Only one scrolllbar would be nice!!)

But is it possible at all in Dynamicweb? I've been looking at several scripts at the web, but last time I tried to solve it, our webpage was totally crashing - so this time I'll ask first :-)

Any experiences with iframes and full page height?

/Lise

Replies

 
Nicolai Høeg Pedersen
Reply
Hi Lise

If it can be done, you can do it in Dynamicweb too manipulating the templates.

What you need is the height of the document inside the iframe and set your iframe to that height (plus maybe a little more).

To do that, you have to know from the beginning a height or max height of the content in iframe and use that height on your iframe.

Another possibility is to read the iframe documents height using javascript, but that would be cross site scripting which is not allowed by most browsers.
 
Reply
Hi,

Actually you can get the iframe's content height if the iframe's url has the same domain. There is a trick to get the height in cross-browsing scripting, check out the attachment.

Note: http://www.domain.pt != http://domain.pt

Nuno

 

You must be logged in to post in the forum