表格行指向变色,请运行偶写的代码:
function table_tr_changec(){
var tableObj=document.getElementById('de_table') ;
var tableobj_tr=tableObj.getElementsByTagName('tr');
var tableobj_tr_len=tableobj_tr.length;
var hover_color='#FF0000';
var normal_color='#FFFFFF';
for(var i=0;i
this.flog=0;
tableobj_tr[i].οnmοuseοver=function (){
this.style.cursor='pointer';
this.flog=1;
if(this.flog==1){
this.style.backgroundColor=hover_color;
}
}
tableobj_tr[i].οnmοuseοut=function (){
this.flog=0;
this.style.backgroundColor=normal_color;
}
}
}
var ta_lock;
function table_hover(){
ta_lock=setInterval("table_tr_changec()");
}
function table_out(){
clearInterval(ta_lock);
}
dfdf | dsf |
fdsf | sdf |
sdfs | sdfsd |