• 一行JS代码实现的滑动门


    代码简介:

    一款经典简洁的CSS滑动门代码,来自经典论坛,很多网站都见到过这种,代码并不多,非常实用。响应鼠标滑过而不是点击鼠标才切换,适你的需要了,滑动门的灵魂所在。

    代码内容: 

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>一行JS代码实现的滑动门_网页代码站(www.webdm.cn)</title>
    <style media="screen" type="text/css">
    <!--
    *{font-size:12px;}
    html,body{margin:0;text-align:center;over-flow:hidden;height:100%;100%;}
    UL{list-style-type:none; margin:0px;}
    /* 标准盒模型 */
    .ttl{height:18px;}
    .ctt{height:auto;padding:6px;clear:both;border:1px solid #064ca1;border-top:0;text-align:left;}
    .w936{margin:2px 0;clear:both;936px;/*滑动门的宽度*/}
    /* TAB 切换效果 */
    .tb_{background-image: url('http://www.webdm.cn/images/20101207/3/tabs1.gif'); background-repeat: repeat-x;background-color: #E6F2FF;}
    .tb_ ul{height:24px;}
    .tb_ li{float:left;height: 24px;line-height:1.9; 94px;cursor:pointer;}
    /* 控制显示与隐藏css类 */
    .normaltab   { background-image:url('http://www.webdm.cn/images/20101207/3/tabs2.gif'); background-repeat: no-repeat; color:#1F3A87 ;}
    .hovertab    { background-image: url('http://www.webdm.cn/images/20101207/3/tabs3.gif'); background-repeat: no-repeat; color:#1F3A87; font-weight:bold }
    .dis{display:block;}
    .undis{display:none;}
    -->
    </style>
    <script type="text/javascript" language="javascript">
    //<!CDATA[
        function g(o) { return document.getElementById(o); }
        function HoverLi(n) {
            //如果有N个标签,就将i<=N;
            for (var i = 1; i <= 6; i++) { g('tb_' + i).className = 'normaltab'; g('tbc_0' + i).className = 'undis'; } g('tbc_0' + n).className = 'dis'; g('tb_' + 
    
    n).className = 'hovertab';
        }
        //如果要做成点击后再转到请将<li>中的onmouseover 改成 onclick;
    //]]>
    </script>
    </head>
    <body>
    <div class="w936">
     <div id="tb_" class="tb_">
       <ul>
        <li id="tb_1" class="hovertab" onmouseover="x:HoverLi(1);">
        ASP.NET</li>
        <li id="tb_2" class="normaltab" onmouseover="i:HoverLi(2);">
        MYSQL</li>
        <li id="tb_3" class="normaltab" onmouseover="a:HoverLi(3);">
        DELPHI</li>
        <li id="tb_4" class="normaltab" onmouseover="o:HoverLi(4);">
        VB.NET</li>
        <li id="tb_5" class="normaltab" onmouseover="g:HoverLi(5);">
        JAVA</li>
        <li id="tb_6" class="normaltab" onmouseover="z:HoverLi(6);">
        PHP5</li>
       </ul>
     </div>
     <div class="ctt">
      <div class="dis" id="tbc_01">这里是ASP.NET的相关内容</div>
      <div class="undis" id="tbc_02">这里是MYSQL的相关内容</div>
      <div class="undis" id="tbc_03">这里是DELPHI的相关内容</div>
      <div class="undis" id="tbc_04">这里是VB.NET的相关内容</div>
      <div class="undis" id="tbc_05">这里是JAVA的相关内容</div>
      <div class="undis" id="tbc_06">这里是PHP5的相关内容</b>
      </div>
     </div>
    </div>
    <br />
    <p><a href="http://www.webdm.cn">网页代码站</a> - 最专业的网页代码下载网站 - 致力为中国站长提供有质量的网页代码!</p>
    </body>
    </html>
    
    代码来自:http://www.webdm.cn/webcode/e6e41004-c754-4953-8e78-1654e13fe979.html
    
  • 相关阅读:
    CISCO一些基本配置
    每日学习
    每日学习(个人作业2)
    每日学习
    团队冲刺第十四天
    每日学习
    团队冲刺第十三天
    每日学习
    团队冲刺第十二天
    2021.5.26
  • 原文地址:https://www.cnblogs.com/webdm/p/2102844.html
Copyright © 2020-2023  润新知