Hi
I’m using the following javascript to swap a whole bunch of images with an onClick link. the problem is the “sel” variable. it is set with the onClick like this:
[code=php]onClick=”bullet(L1);
but for some reason it’s not getting the varaible in the ‘Prop(sel,”,’src’,red,’IMG’);’ part of the script.
[code=php]
function Prop(objName,x,theProp,theValue) {
var obj = MM_findObj(objName);
if (obj && (theProp.indexOf(“style.”)==-1 || obj.style)){
if (theValue == true || theValue == false)
eval(“obj.”+theProp+”=”+theValue);
else eval(“obj.”+theProp+”='”+theValue+”‘”);
}
}
function bullet(sel){
var blue = ‘images/fmp_blue_bullet.jpg’;
var red = ‘images/fmp_red_bullet.jpg’;
Prop(‘L1′,”,’src’,blue,’IMG’);
Prop(‘L2′,”,’src’,blue,’IMG’);
Prop(‘L3′,”,’src’,blue,’IMG’);
Prop(‘L4′,”,’src’,blue,’IMG’);
Prop(‘L5′,”,’src’,blue,’IMG’);
Prop(‘L6′,”,’src’,blue,’IMG’);
Prop(‘L7′,”,’src’,blue,’IMG’);
Prop(‘L8′,”,’src’,blue,’IMG’);
Prop(‘L9′,”,’src’,blue,’IMG’);
Prop(‘L10′,”,’src’,blue,’IMG’);
Prop(sel,”,’src’,red,’IMG’);
}
Any ideas anyone.
Chris