Click to See Complete Forum and Search --> : How to... swap image set variable for image popup on click?


simmonet
10-02-2003, 07:40 PM
I have a catalog of images that I want to have load into the same space on the mouse click of a text link

ie I have a list of 10 links each one changes the image to one of 10 images

I then want to be able to click on the image to enlarge

All images and enlargements follow the same protocol ie image01.jpg = image01-large.jpg

So I want to change the image, and save a variable so when the image is clicked on it uses the variable to open the image in a dynamically generated page (passes the variable and draws the new page)

It sounds really easy on paper but is more difficult than I personally can handle.

If this requires more assistance than can be provided on list I can go off list to discuss (and pay for a solution)!

TIA

simmonet
10-02-2003, 10:15 PM
got it working but still need some additional help

In head:

function newWindow(productImage) {
bigPic=productImage
productWindow=window.open(bigPic,"ProductWin","width=600,height=500")
productWindow.focus()
}

In link (to change image):

javascript: product.src='images/newimage.jpg'

On image (click to enlarge):

javascript:newWindow(product.src)

Now what I need to do is to find a way to calculate:

1) take the last 4 characters of productImage (.jpg)
2) insert a standard suffix (-t)
3) add a suffix to that (.jpg)

so I end up with the new page containing the image 'newimage-t.jpg'

hopefully

I still haven't grasped the regular expressions formatting any help on the calculation to make this happen appreciated.

TIA