zoukankan      html  css  js  c++  java
  • DEMO:Tab切换

    <html>
    
    <head>
        <style type="text/css">
    
        .divtab .tabhead{font-size: 14px;color: #a7a7a7;}
    
        .divtab .tabhead .tabhead-list{position: relative;top: 3px;height: 27px;margin: 0;padding: 0;border-bottom: 2px solid #f0f0f0;}
    
        .divtab .tabhead .tabhead-list li{line-height: 21px;display: inline-block;float: left;width: 90px;text-align: center;*zoom: 1;*display: inline;}
    
        .divtab .tabhead .tabhead-list li.on{color: #e55555;}
    
        .divtab .tabhead .tabhead-list li:hover{cursor: pointer;}
    
        .divtab .tabhead .tabhead-list p{position: absolute;top: 27px;width: 90px;height: 2px;margin: 0;background: #e55555;}
    
        .divtab .tabbody{padding-top: 12px;}
    
        .divtab .tabbody .tabone{position: relative;display: none;overflow: auto;}
    
        .divtab .tabbody .tabone.show{display: block;}
    
        </style>
    </head>
    
    <body>
        <div class="divtab">
            <div class="tabhead">
                <ul class="tabhead-list">
                    <li id="atab" class="on">A</li>
                    <li id="btab">B</li>
                    <li id="ctab">C</li>
                    <li id="dtab">D</li>
                    <li id="etab">E</li>
                    <li id="ftab">F</li>
                    <p></p>
                </ul>
            </div>
            <div class="tabbody">
                <div class="tabone show" id="Acon">AAAAA</div>
                <div class="tabone" id="Bcon">BBBBB</div>
                <div class="tabone" id="Ccon">CCCCC</div>
                <div class="tabone" id="Dcon">DDDDD</div>
                <div class="tabone" id="Econ">EEEEE</div>
                <div class="tabone" id="Fcon">FFFFF</div>
            </div>
        </div>
        <script type="text/javascript" src="http://libs.baidu.com/jquery/2.0.0/jquery.js"></script>
        <script language="javascript">
        $(function() {
            $('.tabhead-list li').mouseover(function() {
                $(this).css("cursor", "pointer");
            });
            $('.tabhead-list li').click(function() {
                var liindex = $('.tabhead-list li').index(this);
                $(this).addClass('on').siblings().removeClass('on'); //.siblings() 获得匹配集合中每个元素的同胞
                $('.tabbody div.tabone').eq(liindex).fadeIn(150).siblings('div.tabone').hide();
                var liWidth = $('.tabhead-list li').width();
                $('.divtab .tabhead-list p').stop(false, true).animate({
                    'left': liindex * liWidth + 'px'
                }, 300);
            });
        });
        </script>
    </body>
    
    </html>
  • 相关阅读:
    迅为iTOP4412开发板支持4G以上文件系统扩展
    迅为瑞芯微itop3399开发板Android8系统wifi移植
    centos 下安装显卡驱动步骤
    smarty函数转载
    jquery.qrcode二维码插件生成彩色二维码
    转 jquery插件241个jquery插件—jquery插件大全
    收集的jquery插件
    主机屋空间
    用过的php函数
    VeryMule网上商城
  • 原文地址:https://www.cnblogs.com/Feng-Scorpio/p/6474399.html
Copyright © 2011-2022 走看看