Forum Moderators: open
To follow through, in your mouseOver and mouseOut events, don't just do simple rollovers, but first test to see if C is displayed - and in that case just escape and do nothing.
<script language="javascript" type="text/javascript"> var images = new Array(2); // How many buttons do you have? function overfunc(which) { </script> <a href="javascript:void(0)" onmouseover="overfunc('button1')" onmouseout="outfunc('button1')" onmousedown="downfunc('button1')"><img src="a.gif" name="button1" id="button1" /></a> <a href="javascript:void(0)" onmouseover="overfunc('button2')" onmouseout="outfunc('button2')" onmousedown="downfunc('button2')"><img src="a.gif" name="button2" id="button2" /></a>
image[0] = new Image;
image[1] = new Image;
image[0].src = "a.gif";
image[1].src = "b.gif";
var buttons = new Array(2);
document.images[which].src = image[1].src;
}
function outfunc(which) {
if(buttons[which] != 1) {
document.images[which].src = image[1].src;
}
}
function downfunc(which) {
if(buttons[which] == 1) {
buttons[which] = 0;
}
else {
buttons[which] = 1;
}
}