Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > How can I determine proper height of an Iframe subpage?

Thread Tools

How can I determine proper height of an Iframe subpage?

Posts: n/a
<A href="">Iframes
SSI Script II</a>

My Test page below has a Prayer in it that randomly loads a new prayer
each time someone clicks on the prayer itself. The 1st prayer does not
have the proper HEIGHT in it though. Because each prayer is randomly
selected. Each prayer has a different HEIGHT & WIDTH. For testing
purposes I have included a test page. You can load the test page to
see how the prayer does not have the proper HEIGHT IFrame. Then click
on it to load a new prayer and to see it resize itself. Then feel free
to examine the Javascript & HTML code to figure out how to get the
iframe to determine the proper HEIGHT the 1st time when the page loads
in the browser.

This script resizes an IFrames HEIGHT when content is loaded into it.
It works great. The problem is that the first time it appears it does
not use the proper HEIGHT. I think because I did not give it one. The
reason I did not give the IFrame a HEIGHT value is because each
sub-page loaded into it is randomly selected. The HEIGHT & width are
different each time. I get around the width issue by giving it a value
of 100%. But how can I get the script to apply the proper Height value
the first time the page loads?

Part 2:
If anyone can help me with the width problem too, that would be
great!! How can I get the script to resize to the proper HEIGHT &
WIDTH each time? Because each sub-page in the IFrame is RANDOMLY

Here is the URL for my <a
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Why can't I change height with <col width="50" height="100">? Bernd Meier HTML 6 01-14-2008 07:25 AM
Div inside an iframe - how to set height relative to the iframe's visible size? Joe Attardi Javascript 0 01-17-2006 08:01 PM
How can I determine the page layout (width and height) Leo ASP .Net 2 10-12-2004 06:12 PM
Get form values from iframe (1) to iframe (2) inside a layer in iframe (1) Daedalous Javascript 3 01-16-2004 11:08 AM