This seems like a rather straightforward and simple idea. And Ive got most of it ironed out, but am running into a wall. I pulled most of this code from various sites after a lot of searching.
To begin, I have a simple image. It is actually a sliced image (trust me, best for this project) so that the pieces which I am looking to have change based on radio button selection can simply change by changing the <img src> of each piece to change.
NO problem for just one image (slice).
And I am using the <img name="xxx" src="yyy" /> setup for all the images.
And this for the radio button(s)
But I really can not figure out how to have multiple things like this on the same page.
I would like to have like 6 or 7 different groups of radio buttons. So that each group changes ONE piece of the image (remember, it is sliced and I simply need to just change the img src to change the color).
What am I missing here!?
To put it in real world terms:
Imagine a stick figure on your screen. There are groups of radio buttons like hat, shoes, shirt, gloves. And in each group are multiple choices like red, green, blue, yellow. So clicking hat-yellow puts a yellow hat on the stick figure. Red shoes and so on and so forth. In my case, the hat/head or feet/shoes are a sliced .jpg which can be changed by simply changing the img src path to point to a different color.
To begin, I have a simple image. It is actually a sliced image (trust me, best for this project) so that the pieces which I am looking to have change based on radio button selection can simply change by changing the <img src> of each piece to change.
NO problem for just one image (slice).
Code:
function ChangeImage(newimage)
{
document.[COLOR=Red]nameofimage[/COLOR].src=newimage;
}
And this for the radio button(s)
Code:
<input type="radio" value="value_of_radio" onclick="ChangeImage('--New Image src Here--')" />
I would like to have like 6 or 7 different groups of radio buttons. So that each group changes ONE piece of the image (remember, it is sliced and I simply need to just change the img src to change the color).
What am I missing here!?
To put it in real world terms:
Imagine a stick figure on your screen. There are groups of radio buttons like hat, shoes, shirt, gloves. And in each group are multiple choices like red, green, blue, yellow. So clicking hat-yellow puts a yellow hat on the stick figure. Red shoes and so on and so forth. In my case, the hat/head or feet/shoes are a sliced .jpg which can be changed by simply changing the img src path to point to a different color.
Last edited: