...

View Full Version : avoiding onMouseover when onClick



loonatik
06-09-2003, 03:07 AM
Calling these functions within <td>

function over(){
window.event.srcElement.style.color = 'black';
}
function out(){
window.event.srcElement.style.color = 'gray';
}
function click(){
window.event.srcElement.style.color = 'black';
}

The default color of the text in a <td> is gray. When onClick, the text is black, but because the out() function is also called in the <td>, the text turns back to gray as soon as the mouse moves out. Any way to make the text remain black when clicked? Thanks.

chrismiceli
06-09-2003, 05:42 AM
you could remove the commands to change the style when clicking, like this



function over(){
window.event.srcElement.style.color = 'black';
}
function out(){
window.event.srcElement.style.color = 'gray';
}
function click(){
window.event.srcElement.onMouseOut = "";
window.event.srcElement.style.color = 'black';
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum