![]() |
|
||||||||||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
|||||
|
|
#1 |
|
WLC Member
Join Date: Jul 2008
Location: USA
Posts: 22
|
Does anybody know how to do this:
click on a color swatch and a remote image changes. like the car websites do. ![]() I don't know if this can be done with only css or if there needs to be javascript, too. Thanks! Cway |
|
|
|
|
|
#2 |
|
WLC Mod
Join Date: Jul 2009
Location: Milky Way Galaxy
Posts: 3,134
|
Flash would be the easiest way, but Javascript if you can't do Flash.
__________________
Praise be to the Lord God for the ability to learn, the capability to analyze, and the time to help users on this forum. |
|
|
|
|
|
#3 |
|
WLC Member
Join Date: Jul 2008
Location: USA
Posts: 22
|
Thanks for the quick reply, meesa!
Do you know of a good flash or javascript? |
|
|
|
|
|
#4 |
|
WLC Mod
Join Date: Jul 2009
Location: Milky Way Galaxy
Posts: 3,134
|
Here is a simple JS code.
Code:
<script type="text/javascript">
var pics=new Array(
"pic1-URL.jpeg",
"pic2-URL.jpeg");
function cngImg(num){
document.getElementById('slideshow').src=pic[num];
}
</script>
HTML Code:
<div> <img src="originalImg.jpeg" id="slideshow" alt="" /> <img src="redButton.jpeg" alt="" onclick="cngImg(0)" /> <img src="blueButton.jpeg" alt="" onclick="cngImg(1)" /> </div> Also make sure that you don't tell it to go to an image that doesn't exist, your highest number should be how many URLs you have minus 1 (because it starts at 0)
__________________
Praise be to the Lord God for the ability to learn, the capability to analyze, and the time to help users on this forum. |
|
|
|
|
|
#5 |
|
WLC Member
Join Date: Jul 2011
Posts: 5
|
This is how I would go about it. This seems to be the easiest way. Basically you will be displaying a different image with each selection. I am not sure if there is a way to actually change the color on the same image, which I imagine is the approach that you may have been going for. I would just use different images.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
Linear Mode |
|
|