I have a script that works great except one small problem. It's easiest to explain with visual aid
http://avalon.eaw.com/#finishes
this uses the background position property to animate the color changes. the only problem is that the "horn" options are hard-coded such that if you are currently viewing a speaker that has white cab with a colored horn and want to change the cabinet to black, it changes the horn to black as well. there is no way currently to view a black cab with colored horn.
to fix it i need to make a conditional statement but am not sure how to make it work. something like:
Code:
function colorChange() {
$("#target").css('background-position', xposition+'px '+yposition+'px');
if $("#target").css('background-position') == {x:-754} {
updatePositions({x:-377});
} else if $("#target").css('background-position') == {x:-377} {
updatePositions({x:-754});
}
}
i'm very new to javascript so please be gentle