zoukankan      html  css  js  c++  java
  • 单元格变色和图片透明

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

    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>

  • 相关阅读:
    数组中的逆序对★★
    把数组排成最小的数★★★
    丑数★★★
    整数中1出现的次数(从1到n整数中1出现的次数)
    连续子数组的最大和
    每两个字符串中插入字符串
    linux R环境安装以及注意事项
    JAVA调用R脚本 windwos路径下
    springboot 配置多数据源
    springboot 在配置文件写参数注入到类中
  • 原文地址:https://www.cnblogs.com/zerogo/p/2209351.html
Copyright © 2011-2022 走看看