日期:2014-05-18  浏览次数:20424 次

郁闷——散分!
<script   language= "javascript "   type= "text/javascript ">
var   selectedRowIndex   =   -1;
var   isSelected   =   false;
var   originalColor   =   '#FFFFFF ';
var   selectedColor   =   '#ff0000 ';
var   mouseOverColor   =   '#ff00ff ';
var   mouseOverSelectedColor   =   '#aa00aa ';
function   mouseOver(o){
isSelected   =   (selectedRowIndex   !=   undefined   ||   selectedRowIndex   !=   -1)   &&   selectedRowIndex   ==   o.rowIndex;
if(isSelected){
o.bgColor   =   mouseOverSelectedColor;
}
else{
o.bgColor   =   mouseOverColor;
}
}
function   mouseOut(o){
isSelected   =   (selectedRowIndex   !=   undefined   ||   selectedRowIndex   !=   -1)   &&   selectedRowIndex   ==   o.rowIndex;
if(isSelected){
o.bgColor   =   selectedColor;
}
else{
o.bgColor   =   originalColor;
}
}
function   mouseClick(o){
if(o.tagName   ==   "TR "){
for(i   =   0;   i   <   o.parentElement.rows.length;   i++){
o.parentElement.childNodes[i].bgColor   =   originalColor;
}
selectedRowIndex   =   o.rowIndex;
o.bgColor   =   selectedColor;
}
}
</script>

<table   border= "1 "   width= "100% ">
    <tr   onclick= "javascript:mouseClick(this); "   onmouseover= "javascript:mouseOver(this); "   onmouseout= "javascript:mouseOut(this); ">
<td   width= "20% ">   </td> <td   width= "20% ">   </td> <td   width= "20% ">   </td> <td   width= "20% ">   </td> <td   width= "20% ">   </td>
    </tr>
    <tr   onclick= "javascript:mouseClick(this); "   onmouseover= "javascript:mouseOver(this); "   onmouseout= "javascript:mouseOut(this); ">
<td   width= "20% ">   </td> <td   width= "20% ">   </td> <td   width= "20% ">   </td> <td   width= "20% ">   </td> <td   width= "20% ">   </td>
    </tr>
    <tr   onclick= "javascript:mouseClick(this); "   onmouseover= "javascript:mouseOver(this); "   onmouseout= "javascript:mouseOut(this); ">
<td   width= "20% ">   </td> <td   width= "20% ">   </td> <td   width= "20% ">   </td> <td   width= "20% ">   </td> <td   width= "20% ">   </td>
    </tr>
</table>

------解决方案--------------------
jf
------解决方案--------------------
差不多了..接分
------解决方案--------------------
jf
------解决方案--------------------
jf
------解决方案--------------------