[Javascript] Re-assign URL of swapped image

bill myers flex at interport.net
Mon Jun 30 22:30:24 CDT 2003


thierry,
i have always done it really straightforwardly.
for instance...

>>if(document.images['Cover'].src == 
>>"../../../../images/product/Covers/BummiCotton_Bear_M.jpg") {
	window.location.href = "bear.html;}

you can add targets that way

	{window.location.blank.href = "bear.html";}

if you go back to the older apple.com/support page you will see just 
about everything that can be done with swapping urls and images.
(it actually swaps image maps on rollover)

http://web.archive.org/web/20020124204241/http://www.apple.com/support/


bill



>Hi,
>Please see
>http://www.8p-design.com/Bummis/New/en/Products/covers/BummiCotton.html
>
>When you click on the two swatches, the diaper image swap. All fine.
>Now, I would like the user to click on the swapped image and get directed to
>a LARGER copy of the image in another window. But, I don't know how to swap
>the URL when changing the image.
>
>Could someone guide?
>
>Also, if someone has a better/cleaner javascript than the one I'm using for
>this image swap, please point it to me. This one works, but seems bulky for
>nothing.
>
>Thanks!
>--
>Thierry

>>To open a new window with a bigger version, Do you want them to 
>>click the bigger picture already displayed?  if so, wrap your <img> 
>>in an <a> with an onClick to open the new window.  You can find out 
>>which of the two images is currently displayed by
>>
>>if(document.images['Cover'].src == 
>>"../../../../images/product/Covers/BummiCotton_Bear_M.jpg") {
>>	winURL = "../../../../images/product/Covers/BummiCotton_Bear_L.jpg";



More information about the Javascript mailing list