Forum Moderators: open

Message Too Old, No Replies

Tricky IFrame Problem (yes it's about the dynamic height, again)

         

Bigzed

7:31 pm on Oct 7, 2006 (gmt 0)

10+ Year Member



Hey Guys,
I've done my research for a script that dynamically adjusts the height of the Iframe, but none of the scripts have got the features, which I all need. Maybe one of you can help me:

1. The site contained in the Iframe is no on the same Domain nor Server as the main page

2. I can't put any code in the Iframe (YES, I do have permission to include the Iframe ;-)

3. The height needs to adjust not just the first time the mainpage loads, but also everytime somebody opens a new site in the Iframe. The height needs to be readjusted in that case, too.

If the script works for IE only, it'll be better than nothing (as long as it works for other browsers with scrollbars) and if it works for IE and Mozilla only I'm good.

Alright.. I hope somebody can help me. I'd be veeeeery grateful.
Thanks.
Flo from Berlin.

daveVk

2:17 am on Oct 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



1. The site contained in the Iframe is no on the same Domain nor Server as the main page

Security will prevent you from seeing iframe content. You may need to consider a server side solution, PHP maybe.

[msdn.microsoft.com...]

DrDoc

5:04 am on Oct 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The height needs to adjust not just the first time the mainpage loads, but also everytime somebody opens a new site in the Iframe. The height needs to be readjusted in that case, too.

Can you expand on the criteria for such iframe height adjustment? If the criteria is unrelated to the page content, it can be done. If height adjustment is directly related to the page loaded in the iframe -- you're SOL, like daveVk mentioned.

Bigzed

11:29 pm on Oct 9, 2006 (gmt 0)

10+ Year Member



Yes - I want the height of the Iframe to depend on the height of the content of the website in the Iframe.

Using php is not an option.

I believe you guys, but I also saw a script working on an alien website, but I believe you had to put code not just in the mainpage but also in the iframe website - so I was wondering if it worked withouth doing that.

Flo.

DrDoc

6:06 pm on Oct 10, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Nope, can't be done then. Sorry :)

kaled

9:19 pm on Oct 10, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



As an alternative, use a hidden iframe and use the innerHTML property to place the contents in a div. This is straightforward, however, CSS will be a problem.

Kaled.

DrDoc

9:40 pm on Oct 10, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You still can't script cross domains ...