PDA

View Full Version : seemingly-dumb question: javascript/collapsible iframe



wyzyrd
04-17-2005, 06:27 PM
hi folks,

I have a dumb question:

I'm building a site for a customer who wants an "AOL-style" inline "popup"
- a hidden iframe object that only appears when a link is clicked to populate it.

IFrame object:

<iframe class= "blueTable"
name= "IFrame1"
id= "bottomBox"
style="top: 300px; width: 525px; scroll: auto; height: 0px;" />
</iframe>

so far I have been able to rezize the box dynamically with a javascript call OR
populate it with an external html file, but not both when the link is clicked.

<a href="faq.html"
target="bottomBox"
onclick="javascript:document.frames.setHeight();"/>Frequently_Asked Questions<img src="gr/go_yellow_btn.gif" border=0></a>

I'm obviously missing something because I'm a server-side (PHP) guy :)

any ideas?
Thanks in advance.
Wyzyrd
<:)}

jscheuer1
04-17-2005, 06:56 PM
<a href="faq.html"
target="bottomBox"
onclick="javascript:document.frames.setHeight();"/>Frequently_Asked Questions<img src="gr/go_yellow_btn.gif" border=0></a>Try targeting the iframe by its name:

<a href="faq.html"
target="IFrame1"
onclick="javascript:document.frames.setHeight();"/>Frequently_Asked Questions<img src="gr/go_yellow_btn.gif" border=0></a>This will populate the iframe.

wyzyrd
04-18-2005, 07:17 PM
Thanks, jscheuer1 - that actually helped a lot :)

I gave up on trying to resize the box from a "placeholder-size" to full-size and just wrapped a <div> tag around the whole dang thing and used javascript onClick to show/hide the whole thing.

the help is much appreciated
Wyzyrd
<:)}