Log in

View Full Version : Fixed iFrame popup?



Chris P. Bacon
06-09-2007, 02:20 PM
Hi,

First of all, my website is a PHP website, but I guess what I need can be done with simple HTML.

I got too many news listed on the index site, so I need some kinde of "archive" where people can scroll through older news. The way I want to do this, I want a link that, when you press it, a popup window comes up in a fixed size (and with an iFrame in it) where people can scroll through the old news.

I guess its pretty simple, but I'm a beginner at this, and I have never played around with iFrames... Any help will be very appreciated! :)

Veronica
06-11-2007, 05:28 PM
First, you would create the iframe page, call it newsarchive.htm (or whatever). In this page, you could bring up the iframe by putting in your html:



header stuff

<iframe name="archive" id="archive" src="archive.htm" scrolling="auto" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:100&#37;; height:100%;"></iframe>

footer stuff


Then use javascript to open that page in a new smaller window:



<A HREF="#" onClick="window.open('newsarchive.htm','archive','resizable,height=500,width=650,scrollbars=no'); return false;">News archive</a>


You can set the height and width to whatever you want. Since it's an iframe, you would probably set scrollable to no. However, the iframe within this smaller page would still scroll.

Make sure you iframe page will work in the smaller dimensions.

One other thing, you might want to add copy for people who turn javascript off to just open the archive in a new window. People with javascript turned on won't see this:
<noscript>Please enable javascript or go <a href="newsarchive.htm" target="_blank">here</a></noscript>

Chris P. Bacon
06-11-2007, 05:49 PM
Thanks alot! Thats just what I needed. :D