[Javascript] (no subject)

Ben Curtis Quixote at LaMancha.org
Fri Oct 26 12:28:01 CDT 2001


function clicker(elem1,elem2,elem3,elem4,elem5,elem6,elem7,elem8,elem9,text)
{
    //alert("if"); 
    elem1.style.color = "#ffffff";
    elem2.style.color = "#000000";
    elem3.style.color = "#000000";
    elem4.style.color = "#000000";
    elem5.style.color = "#000000";
    elem6.style.color = "#000000";
    elem7.style.color = "#000000";
    elem8.style.color = "#000000";
    elem9.style.color = "#000000";
    return true;
}


You are having problems with this having any affect because of the default
action for the "return true" part. The "onclick" fires when the user
releases the button, then your code executes and colors the link, but then
the default action happens which is to send the href to the target frame and
then color the link to the visited color instead of the active color.

Try this, and let me know if it works:

function clicker(elem1,elem2,elem3,elem4,elem5,elem6,elem7,elem8,elem9,text)
{
    setTimeout('elem1.style.color = "#ffffff";', 10);
    setTimeout('elem2.style.color = "#000000";', 10);
    setTimeout('elem3.style.color = "#000000";', 10);
    setTimeout('elem4.style.color = "#000000";', 10);
    setTimeout('elem5.style.color = "#000000";', 10);
    setTimeout('elem6.style.color = "#000000";', 10);
    setTimeout('elem7.style.color = "#000000";', 10);
    setTimeout('elem8.style.color = "#000000";', 10);
    setTimeout('elem9.style.color = "#000000";', 10);
    return true;
}

--
+Ben Curtis

    "You must be the change you wish to see in the world."










More information about the Javascript mailing list