单元格变色和图片透明

用单元格变色的方法来做网页导航,在网上可以经常看到,但代码有简有繁,如果运用样式表来实现,将可以节约很多代码,特别是当有很多行需用这种效果时: 

1


 .aa
  { background-color:#aaa; color:#000 }
.bb 
  { background-color:#ccc; color:#000 }

<table width="200" border="0" cellspacing="1" cellpadding="0" >
<tr>
<td onmouseover="this.className='aa'" onmouseout="this.className='bb'" class="bb" >test </td>
<td onmouseover="this.className='aa'" onmouseout="this.className='bb'" class="bb" > test</td>
<td onmouseover="this.className='aa'" onmouseout="this.className='bb'" class="bb" > test</td>
</tr>
</table>
2

table#changecolor td a {
 100%;
 display:block;
 background-color:#ccc;
}
table#changecolor td a:hover {
 100%;
 background-color:#aaa;
}

<table id="changecolor" width="200" border="0" cellspacing="1" cellpadding="0" >
<tr>
<td ><a href="##">test</a>  </td>
<td ><a href="##">test</a>  </td>
<td ><a href="##">test</a>  </td>
</tr>
</table>

图片透明

<SCRIPT language=JavaScript1.2>
<!--
<!--
function high(which2){
theobject=which2
highlighting=setInterval("highlightit(theobject)",30)
}
function low(which2){
clearInterval(highlighting)
which2.filters.alpha.opacity=100
}
function highlightit(cur2){
if (cur2.filters.alpha.opacity>30)
cur2.filters.alpha.opacity-=10
else if (window.highlighting)
clearInterval(highlighting)
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
</SCRIPT>

<IMG
            onmouseover=high(this) style="FILTER: alpha(opacity=100)"
            onmouseout=low(this)
            src="m/menu1.gif"
        border=0>

原文地址:https://www.cnblogs.com/zerogo/p/2209351.html