JS open window help

They have: 34 posts

Joined: Oct 2001

hello-

i have a page of thumbnails that when clicked i would like to open up in a new window w/ specific size and attributes.

i know how to have each tumbnail open it's own html page w/ specific attributes, but...

is there a way to have each thumbnail open the same html page, but with the appropriate image?

am i making sense?

Vincent Puglia's picture

They have: 634 posts

Joined: Dec 1999

Hi getyourbiglobst,

This is one alternative:

in the main page: create a global var called imgSrc and fill it with the image's onClick event handler (I'm just hardwiring it; you don't)

<script>
imgSrc = "http://members.aol.com/grassblad/images/grassblade.gif"

window.open("thumb.htm" + whatever attributes)
</script>

in the 'thumb' page, you fill a var called imgSrc with the value in the original window (opener). then you use a document.write to write out the image

<script>
imgSrc = opener.imgSrc

document.write("")
</script>

Vinny

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

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.