PDA

View Full Version : How can I set a fixed height for the IFRAME SSI script II?



schwim
10-23-2006, 09:19 PM
1) Script Title: IFRAME SSI script II

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/iframessi2.htm

3) Describe problem:

Hi there everyone,

Instead of hiding it from incompatible browsers, I would like to display it with a fixed height. It states in the instructions that the height is hard coded, but I can't find where it's coded at.

How can I tell the script to use a certain height if the browser doesn't support the size-on-the-fly portion of the script?

thanks,
json

ddadmin
10-24-2006, 10:21 AM
First, set the following variable to no:


var iframehide="no"

Then, edit the iframe tag to include an explicit width/height:


<iframe id="myframe" src="externalpage.htm" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:100%; display:none; width: 500px; height: 200px"></iframe>

That should do it.

puremetal
10-24-2006, 11:42 AM
I have the same problem. What I'd really like is for the script to be supported properly in Opera though (as I use this script extensively on my sites) :D

Just tried the proposed solution, however, and the only way in which the frame has any height at all in Opera is to set the iframe's height in px. However this no longer dynamically resizes the frame at all in IE.

To fix this, specify a second height attribute outside the style tag of the iframe, and specify the same height NOT in px (ie. just 2000 or whatever) as per the post above.
This now dynamically resizes the iframe in IE, and gives the frame a fixed height of 2000 (for eg) in FF and Opera. :)


As a side-note, i thought this script was supported in FF :confused:


ps: hi i'm new :)

schwim
10-24-2006, 02:00 PM
Hi there DDAdmin, and thanks for the reply.

Unfortunately, making the changes you suggested caused the script to stop resizing for all browsers.

Any other ideas on how to do it?

thanks,
json

schwim
10-27-2006, 03:12 AM
Anybody at all have an idea how to get this script to use a fixed height in non compatible browsers, while keeping the dynamic sizing for compatible browsers?

thanks,
json