• 滑动门与选项卡互转的实现方法代码


    代码简介:

    滑动门和选项卡在布局和结构方面几乎是一样的,唯一不同的是触发方式,这个是由JavaScript决定的,大致来讲就是将onmouseover改为onclick就行了,本款选项卡以前是款比较流行的滑动门,现在改成了选项卡,大家看看有什么区别。

    代码内容:

    <!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>滑动门与选项卡互转的实现方法代码_网页代码站(www.webdm.cn)</title>
    <style>
    *{
    padding:0;margin:0;
    font-size:12px;
    }
    #main{
    margin:20px;
    }
    ul{
    600px;
    }
    #tab li{
    list-style:none;
    float:left;
    text-align:center;
    padding:0;
    }
    #tab a{
    display:block;
    text-decoration:none;
    94px;
    line-height:24px;
    }
    #cont{
    clear:both;
    border:1px solid blue;
    border-top:0;
    562px!important;
    564px;
    height:190px;
    overflow-y:hidden;
    }
    .common{
    margin:5px;
    }
    .common li{
    list-style:none;
    padding-left:14px!important;
    padding-left:0;
    padding-top:4px;
    }
    .common li a{
    text-decoration:none;
    }
    .common li a:hover{
    color:red;
    }
    .on{
    background:url(http://www.webdm.cn/images/20090922/tabs3_s.gif) no-repeat left bottom;
    }
    .off{
    background:url(http://www.webdm.cn/images/20090922/tabs2_s.gif) no-repeat left bottom;
    }
    </style>
    <script>
    function $(ID){
    return document.getElementById(ID)
    }
    function showTab(ID){
    for(var i=1;i<7;i++){
    if(ID==i){
    $('tab'+i).blur();
    $("tab"+i).className="on";
    $("cont"+i).style.display="block";
    }else{
    $("tab"+i).className="off";
    $("cont"+i).style.display="none";
    }
    }
    return false;
    }
    </script>
    </head>
    <body>
    <div id="main">
    <div id="tab">
    <ul>
    <li><a href="javascript:void(0)" id="tab1" class="on" onclick="showTab('1')">C#源代码</a></li>
    <li><a href="javascript:void(0)" id="tab2" class="off" onclick="showTab('2')">VB源代码</a></li>
    <li><a href="javascript:void(0)" id="tab3" class="off" onclick="showTab('3')">VC源代码</a></li>
    <li><a href="javascript:void(0)" id="tab4" class="off" onclick="showTab('4')">JQUERY</a></li>
    <li><a href="javascript:void(0)" id="tab5" class="off" onclick="showTab('5')">Delphi</a></li>
    <li><a href="javascript:void(0)" id="tab6" class="off" onclick="showTab('6')">JAVA源代码</a></li>
    </ul>
    </div>
    <div id="cont" >
    <div id="cont1" class="common" style="display:block;">
    <li><a href="/soft/2064.shtml" target="_blank">30多个C#基础学习实例</a></li>
    </div>
    <div style="display:none;" id="cont2" class="common">
    <li><a href="/soft/2062.shtml" target="_blank">C#图片/相册管理程序代码</a></li>
    </div>
    <div style="display:none;" id="cont3" class="common">
    <li><a href="/soft/5107.shtml" target="_blank">VB仿Photoshop曲线调整图像亮度源程序</a></li>
    </div>
    <div style="display:none;" id="cont4" class="common">
    <li><a href="/soft/5912.shtml" target="_blank">VB仿RealonePlayer播放器的窗体界面</a></li>
    </div>
    <div style="display:none;" id="cont5" class="common">
    <li><a href="/soft/2064.shtml" target="_blank">30多个C#基础学习实例</a></li>
    </div>
    <div style="display:none;" id="cont6" class="common">
    <li><a href="/soft/5944.shtml" target="_blank">Farbtastic jQuery圆形网页取色插件</a></li>
    </div>
    </div>
    </div>
    </body>
    </html>
    <br>
    <p><a href="http://www.webdm.cn">网页代码站</a> - 最专业的代码下载网站 - 致力为中国站长提供有质量的代码
    
    !</p>
    

    代码来自:http://www.webdm.cn/webcode/4b7cf04e-e35f-4edb-9fc5-90060c88d435.html

  • 相关阅读:
    分页存储过程
    C#,单元测试
    telerik reporting报表
    在Linq to sql 和 Entity framework 中使用lambda表达式实现left join
    .NET提供了三种后台输出js的方式:
    转换人民币大小金额
    ASP.Net Post方式获取数据流的一种简单写法
    js数组中两个有相同删除一个
    我的个人博客
    It is the courage
  • 原文地址:https://www.cnblogs.com/webdm/p/2031686.html
Copyright © 2020-2023  润新知