| MonkeyBrains.net/~rudy/example | Random examples |
Image Swap in Javascript
Hi Rudy, How do I have one big image and then a million ones below that you can click and switch the big one? Example here: Zappos shoes If you click the different colours under the shoe, it changes photos. Thanks, IAnswer: Javascript! Here is a working example:
Then below the big shoe, you have little ones...
There, you have the Layout ... now when you click the little images, nothing happens, so you do this:
What that is is an 'Link' tag that goes nowhere, but has an onClick event that runs LittleFart. You
can't put an onClick on an "img" tag for some stupid reason.
Then at the top of the page, you tell the browser how to do a LittleFart...
basically, you want to take the img name in the image tag you clicked... and
take the word MINI out and stuff the new image into the TheShow image tag.
Make sense? The mini image src is inside the A HREF tag, so you use lastChild
to grab it...
|