text link to popup window

They have: 3 posts

Joined: Apr 2000

I would like to create a text link on a page within a frame that opens a small (typically 300 by 250 pixels) popup window containing a simple image file (no html). How would I go about doing this?

They have: 2,390 posts

Joined: Nov 1998

I suppose you have tried:

I'm not sure if it would work, my js is poor.

JP

[Edited by JP Stones on 09-28-2000 at 04:10 PM]

Vincent Puglia's picture

They have: 634 posts

Joined: Dec 1999

Hi mikkon & welcome to the forum that was lost but is now found!

There are a number of ways. One would be:

var myPop = window.open("pic.html","name of image", "width=100,height=100")

and in your pic.html, put the tags.

another would involve writing the html for the new window on the fly:

document.write(".....">);

if you are lite on javascript, I would recommend going through the javascript primer at: http://htmlgoodies.earthweb.com -- it's well-written, geared for novices, amusing, and covers most everything from vars on up.

http://www.javascriptcity.com also has a number of good application-specific type of tutorials (rollovers, etc)

Vinny

Where the world once stood
the blades of grass cut me still

They have: 2,390 posts

Joined: Nov 1998

just out of curiosity what happens if you call an img as a popup?
JP

Vincent Puglia's picture

They have: 634 posts

Joined: Dec 1999

Hi JP,

I'm not sure what you mean, but...that depends on how the window is defined and what is defined along with it. Many shopping carts & image gallerys pop windows for a larger image than is on the page.

Do you mean: window.open("blah.gif") ? The browsers will just open a window with the image in it

Vinny

Where the world once stood
the blades of grass cut me still

They have: 2,390 posts

Joined: Nov 1998

right, thought so Smiling
JP

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

zerocattle.com/examples/popUp.html

Remove any hard returns from the code if you copy and paste it (just the part that goes in the HTML).

Links to excellent tutorials that cover everything about popup windows.

Smiling Suzanne

They have: 2,390 posts

Joined: Nov 1998

just a note on your ZEROCATTLE website. Don't put the news above the intro text. I've read endless surveys on how this is not a good usability idea.
JP

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Thanks, JP. The news IS the intro in this case. It's the most important part. I am restructuring the site and the purpose of the company. I solemnly promise not to put the news first when it is restructured, as there will be a lovely news page all for itself.

You can reach me at the e-mail address in my profile if you want to discuss my website with me further. I would prefer that it not be open season on my work in an unrelated thread. But I do appreciate the feedback nonetheless! It's very useful, thank you!

If you have any links to those surveys or preferably studies, I would be interested in taking a look at them.

Smiling Suzanne

They have: 3 posts

Joined: Apr 2000

I'm a little confused about the placement of the code provided here. The only code I've used so far is not giving me the results I want. With this particular bit of coding (I'm assuming that most of the code for this operation is basically the same), where do I put it, how do I get the text link I need, and what javascript calls do I put in the section?
THANKS!

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

mikkon, go get the code from my site.

Then put it in the HEAD tags on your page.

Within that code is a comment that outlines how you should use the function within the HTML ( tags). Read that.

Wherever you want the link to open a pop-up window, use the code provided in the comment tag (but you will put in the file, the size, et cetera).

I also have two great tutorials linked in the code, for you to read more about popup windows and how to use them.

If you need more help, please provide a URL and I would be happy to troubleshoot.

Smiling Suzanne

http://www.zerocattle.com/examples/popUp.html

Vincent Puglia's picture

They have: 634 posts

Joined: Dec 1999

Hi Mikon,

What code are you using? One of the one's I posted or Suzanne's? Javascript usually goes between the head tags. Other than somewhere in the body of the frame document, the placement of the link is immaterial since it simply acts as a trigger for calling the function that opens the popUp.

<script language='javascript'>

</script>

Pop the Window

(Nice job, Suzanne. I took a peek at the link and other areas.)
Vinny

Where the world once stood
the blades of grass cut me still

They have: 3 posts

Joined: Apr 2000

For some reason, I could not get the javascript to work (probably because I just found out that PageMill 2.0 doesn't support javascript, and I found a way around that).
However, a bit of snooping and I found another piece of code that works:

This bit seems to have worked well.
Also, when I found the scripts to use, PageMill didn't like the fact that I called the input type a button. I changed it to submit, and that that worked.

[Edited by mikkon on 10-13-2000 at 03:45 PM]

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.