渐变菜单

<script>if( self == top ){top.location = "/myjs/?u=/hw/asp/jsview.asp?id=344";}</script>
<style>
/* 先把这个 xmenu 的样式放到css里 */
.xmenu td{font-size:12px;font-family:verdana,arial;font-weight:bolder;color:#ffffff;border:1px solid #336699;background:#336699;filter:blendtrans(duration=0.5);cursor:hand;text-align:center;}
</style>

<script>
/* 这是把事件动作绑定到菜单上的函数 */
function attachXMenu(objid){
 var tds=objid.getElementsByTagName('td');
 for(var i=0;i<tds.length;i++){
  with(tds[i]){
   οnmοuseοver=function(){
    with(this){
     filters[0].apply();
     style.background='#66CCFF'; //这是鼠标移上去时的背景颜色
     style.border='1px solid #ffffff'; //边框
     style.color='black'; //文字颜色
     filters[0].play();
    }
   }
   οnmοuseοut=function(){
    with(this){
     filters[0].apply();
     style.background='#336699'; //这是鼠标离开时的背景颜色
     style.border='1px solid #336699'; //边框
     style.color='#ffffff'; //文字颜色
     filters[0].play();
    }
   }
  }
 }
}
</script>

<!--菜单从这里开始, 注意要把class设置成和css里相同的, 还要为它设一个id-->
<table class="xmenu" id="xmenu0" width="500" cellpadding="1" cellspacing="4" border="0" bgcolor="#336699" align="center">
<td>My
<td>Name
<td>Is
<td οnclick="location.href='http://lexrus.blueidea.com'">LeX <!--这是按下以后打开一个网页-->
<td>Rus
<td>!!!
</table>

<script>attachXMenu(xmenu0); //在上面这个table结束的地方执行事件动作的绑定, 这里的这个xmenu0就是那个table的id</script>

<!--下面这个是竖排的-->

<br/>
<table class="xmenu" id="xmenu1" width="100" cellpadding="1" cellspacing="4" border="0" bgcolor="#336699" align="center">
<tr><td>My
<tr><td>Name
<tr><td>Is
<tr><td οnclick="location.href='http://lexrus.blueidea.com'">LeX
<tr><td>Rus
<tr><td>!!!
</table>

<script>attachXMenu(xmenu1);</script>
<div style="position: absolute; bottom: 10; right: 0; width: 150; height: 18;cursor:hand;z-index:100000;font:menu;background:infobackground;border:1 solid #999999;padding:4px;">
 <input type="button" name="Button" value="源代码" onClick= 'window.location = "view-source:" + window.location.href'></div>

 


 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值