Forum Moderators: open

Message Too Old, No Replies

Trying to make frames choose their own size

trying to make frames choose their own size

         

JaOtEaY

10:06 pm on Feb 12, 2004 (gmt 0)

10+ Year Member



I have two frames. Frame a and Frame b. Both are links to different pages. I need Frame a, to not squish itself and expand as much as needed to display all of the information. And then Frame b to take up the rest of space. Is this possible? If there are an iframe solutions that would be helpful to!

Thanks...

isitreal

10:13 pm on Feb 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If I understand you right, no it's not possible, both frames and iframes need to be sized on page load, they don't know what is in them, since the iframe or frame tag occur on the parent page, and the content is coming from somewhere else, as an unrelated page to the parent, because of this sizing information for the frame is not available to the parent page except for what you tell it to do explicitly.

JaOtEaY

10:15 pm on Feb 12, 2004 (gmt 0)

10+ Year Member



How about with JavaScript? Is there anyway to put a variable into the frame element? And that a javascript function finds the size?

isitreal

10:21 pm on Feb 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Oh, sure, yes, I thought you wanted the page to find this on its own, yes, if you want to script it in you can do it, but you're always having the trouble that the parent page is there all the time, so it has to reload each time you click a link to get the new information to write out the frame sizing information. It's not easy to get that working though, I wouldn't do it. You could try to do this dynamically, it would be a challenge and probably wouldn't work reliably cross browser, but it's a cool idea if you can get it to work.

The biggest problem is getting the parent page the information before the content loads, since they are two separate pages that's not very easy to do, the parent frame page is built before the frame content appears, then it requests the content sub pages, so it has to be dynamic whatever way it works.

If I were going to try this, I'd do it server side, no frames, dynamic pages in PHP built using the sizing data of the two content sections, but then of course you lose the advantage of using frames, so that would defeate the purpose I guess.

JaOtEaY

10:26 pm on Feb 12, 2004 (gmt 0)

10+ Year Member



Dynamically is definately the way that I want to go. I don't have to worry about cross browsers. Any suggestions of what to read or key phrases to search for to get an idea of where to start? And thanks for all your help