用DHTML做的一个菜单特效

源码:

1<style type="text/css">   
2.menu td{font-size:12px;color:white;font-weight:bold;background:#336699;border:1px solid #336699;filter:blendtrans(duration=0.5);cursor:hand;text-align:center}   
3</style>
 1<script language="javascript" type="text/javascript">   
 2function showFilter(obj){   
 3var tds=obj.getElementsByTagName("td");   
 4for(var i=0;i<tds.length;i++){   
 5with(tds[i]){   
 6onmouseover=function(){   
 7with(this){   
 8filters[0].apply();   
 9style.color='black';   
10style.border='1px solid white';   
11style.background='#66CCFF';   
12filters[0].play();   
13}   
14}   
15onmouseout=function(){   
16with(this){   
17filters[0].apply();   
18style.color='white';   
19style.border='1px solid #336699';   
20style.background='#336699';   
21filters[0].play();   
22}   
23}   
24}   
25}   
26}   
27</script>
1<table bgcolor="#336699" border="0" cellpadding="1" cellspacing="4" class="menu" id="xmenu" width="100">
2<tr><td>0128论坛</td></tr>
3<tr><td>例子二</td></tr>
4<tr><td>例子三</td></tr>
5<tr><td>例子四</td></tr>
6<tr><td>例子五</td></tr>
7<tr><td>例子六</td></tr>
8</table>
1<script>showFilter(xmenu); //里面就的xmenu就是表格的ID号此函数可到处调用</script>
Published At
Categories with 网页设计
Tagged with
comments powered by Disqus