<script>
lastobj=null;
function current(obj)
{
if(lastobj!=null)
{
lastobj.style.background="";
lastobj.style.color="";
}
obj.style.background="blue";
obj.style.color="white";
lastobj=obj;
}
</script>
<table>
<tr><td onclick=current(this)>baseinfo</td></tr>
<tr><td onclick=current(this)>workflow</td></tr>
<tr><td onclick=current(this)>bbs</td></tr>
</table>
lastobj=null;
function current(obj)
{
if(lastobj!=null)
{
lastobj.style.background="";
lastobj.style.color="";
}
obj.style.background="blue";
obj.style.color="white";
lastobj=obj;
}
</script>
<table>
<tr><td onclick=current(this)>baseinfo</td></tr>
<tr><td onclick=current(this)>workflow</td></tr>
<tr><td onclick=current(this)>bbs</td></tr>
</table>
var vform = document.forms[0];
var radios = vform[ob];
for(var a=0;a<radios.length;a++){
if(radios[a].checked){
radios[a].parentElement.parentElement.className="trNewBgColor";
}else{
radios[a].parentElement.parentElement.className=((a%2==1)?"trOld1":"trOld2");
}
}
}附上样式表:
<style type="text/css">
<!--
.trNewBgColor {
background-color: #FFEEDD
}
.trOld1{
background-color: #F0F0FF
}
.trOld2{
background-color: #FFFFFF
}
-->
</style>
lastobj=null;
function current(obj)
{
if(lastobj!=null)
{
lastobj.style.background=lastbackground;
lastobj.style.color=lastcolor;
}
lastobj=obj;
lastbackground=obj.style.background;
lastcolor=obj.style.color;
obj.style.background="blue";
obj.style.color="white";
}
</script>
<table>
<tr><td onclick=current(this) style="color:blue;background:white">baseinfo</td></tr>
<tr><td onclick=current(this) style="color:yellow;background:gray">workflow</td></tr>
<tr><td onclick=current(this) style="color:blue;background:white">bbs</td></tr>
<tr><td onclick=current(this) style="color:yellow;background:gray">information</td></tr>
<tr><td onclick=current(this) style="color:blue;background:white">view</td></tr>
<tr><td onclick=current(this) style="color:yellow;background:gray">memo</td></tr>
</table>
function changeBGcolor(ob){
var vform = document.forms[0];
var radios = vform[ob];
for(var a=0;a<radios.length;a++){
if(radios[a].checked){
radios[a].parentElement.parentElement.className="trNewBgColor";
}else{
radios[a].parentElement.parentElement.className=((a%2==1)?"trOld1":"trOld2");
}
}
}附上样式表:
<style type="text/css">
<!--
.trNewBgColor {
background-color: #FFEEDD
}
.trOld1{
background-color: #F0F0FF
}
.trOld2{
background-color: #FFFFFF
}
-->
</style>