View Full Version : Help with popups and frames

May 19th, 2005, 05:41 AM
On my website I have links to a lot of pictures and websites that currently open up new windows. What I would like to do is this:
On the picture it would be a link to a seperate HTML/Javascript page with the URL of the picture or the HTML page or whatever.
This would open a javascript window (with no toolbar or adress bar) that contains 2 frames: the top one would be the picture or the page, and the bottom frame would be a graphic and a "Close" link.

Its kind of hard to explain what I'm asking, but what I basically want is a popup window that loads content in based on whats in the URL.

Lets say there was a picture titled 'haha.jpg'. The link on the main page would be contain a launch link with haha.jpg in it. It would launch a window (probably 640x480) that then takes the url and loads in haha.jpg. The main thing I need is for it to be able to load anything in to the frame so I don't have to make a seperate page with the frames for each image. Any help would be greatly appriciated. I already know how to make the close button and kind of how to make the window, so only reply if you know exactly how to do all of my question.

general knorr
May 19th, 2005, 06:19 AM
There's a slideshow tutorial out there somewhere common. As I recall it's exactly what you're requesting. Try in the webmonkey tutorials. http://webmonkey.wired.com/webmonkey/98/03/index3a_page11.html?tw=programming If not there, try the tutorials here at codingforums.com
I found them to be nice and straightforward.

is a large rather repetitive site for references to tutorials.

May 20th, 2005, 07:35 AM
No help. It pokes around what I want, but still not the thing. I searched for a long time, there doesn't seem to be a tutorial for what I want; too specific. I know minimal amounts of Javascript, but I know its abilities. Review my original bid carefully- I really would like to know how to do this. It has to be a popup window (the tutorial didn't cover this) with 2 frames in it, one which loads a page or image that it is told to do so in the link (its not a pre-programmed page- it is told what to load in the frame). The other frame will just be my logo. Don't point me to a tutorial unless it is exactly this (the webmonkey wasn't even close.) Does anyone know Javascript that can help?

Bill Posters
May 20th, 2005, 08:20 AM
example using javascript (http://junk.newplasticarts.co.uk/forum-examples/passing-vars-via-url-using-js/index.html)
(Take a look at the source of each page.)

The start page:

Reads the image file name from the link href.
Converts the image file name into a variable.
Builds a new url by adding the variable onto the end of the url of the display page (a 'querystring').
Launches the display page url (incl. the querystring) in a popup window.

The gallery display page:

Reads the full url containing the querystring and turns it into an array of parts.
Isolates the very last part (the image file name).
Waits for the page to load.
Swaps the src attribute of the default 'loading' image for the new image file name.

This method still allows users without javascript to view the image. They can return to the previous page using the browser 'Back' button as normal.

As you'll see from the example, you don't need to use framesets.
In fact, it's generally better not to use framesets.

May 20th, 2005, 09:38 AM
This (http://www.codingforums.com/showthread.php?t=9836) doesn't need an HTML file to display the image in a popup window. It dynamically creates the popup window.

BTW, I also agree with not using a frameset.