PDA

View Full Version : How to open iframe src on button click and close



leenark
06-09-2006, 02:45 AM
Hi,

I am a newbie at CSS and javascript design.
I have question on iframe: I want to use iframe to show a presentation(will consist of some linked html files) but that iframe should open only after clicking button, and close after presentation is over.otherwise(when presentation is not showing picture will appear)
Is it possible to place that iframe over existing div, where I am showing some images? Or is there way to hide that iframe and show onclick of button. I know I will have to use some javascript but i have no clue.
any help in this matter would be aprreciated.


thanks,
Leena

djr33
06-09-2006, 05:10 AM
While this may be possible, you might want to find a different solution. Having an iframe cover elements of a page is probably possible, but would be limited to certainly new browsers, if not only a few new browsers.

There are ways to make popups of things in the page, not frame, but divs, etc. Some scripts here on DD will do that.

In the end, you might just want a popup window; that would be easier and more compatible.

I'm guessing that you have figured out some way to display the presentation in the iframe, but it might be better to figure out a new way not needing an iframe.

Someone else can probably tell you the code for the frame, but I just am not sure how easy that will be to make work for enough people.


Please post a link to the page on your site that contains the problematic script so we can check it out.