Click to See Complete Forum and Search --> : row highlight
I have rows of records displayed in a table.Each row has a mouseover menu.When I click a menu item for that row, it highlights the row.
(khalid helped me with the row highlight).It works well.But, when I hover over the next row menu, the highlight disapperars.The highlight on the previous row should disappear only after clicking the menu item from next row.How can I do this?I've attached my html file.
thanks
khalidali63
05-16-2003, 10:49 AM
Hey Milli,
here you go,just replace the layer highliting code section with this piece,I have made necessary changes..
<script language="Javascript">
var prevRow;
var preEl ;
var currentRow;
var orgBColor;
var orgTColor;
function resetRow(row){
if(row!=null){
row.style.backgroundColor="#FFFFFF";
ChangeTextColor(row.getElementsByTagName("td"),"#003366");
}
}
function HighLightTR(backColor,textColor){
if(currentRow!=null){
var row = currentRow;
resetRow(prevRow);
prevRow = currentRow;
layerOn = true;
row.style.backgroundColor = backColor;
ChangeTextColor(row.getElementsByTagName("td"),textColor)
}
}
function ChangeTextColor(tds,a_color){ ;
for(var n=0;n<tds.length;n++){
tds[n].style.color=a_color;
}
}
</script>
Thanks for your response, khalid :)
but this still doesnt work the way i wanted it to.The highlight disappears on the first row when I hover over the second.I want it to disappear only after clicking a menu item from second row.Am I missing something?
khalidali63
05-16-2003, 11:04 AM
something you pro'lly missed in copying..:-)
try this link.
http://68.145.35.86/temp/milli/menu_row_hilite.html
Thanks :)
I believe you also deleted this line:
currentRow = (currentRow!=null)?resetRow(currentRow):null;
from the other script.I was missing this change
works now.
Thanks
khalidali63
05-16-2003, 02:09 PM
you are welcome..:D