JQuery--实现标签页




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <title>添加商品</title>
        <meta http-equiv="content-type" content="text/html;charset=utf-8">
       <script src="http://cdn.static.runoob.com/libs/jquery/1.10.2/jquery.min.js">
</script>

        <style type="text/css">
            #tabbar-div{
                background:none repeat scroll 0 0 #80BDCB;
                height: 27px;
                padding-left: 10px;
                padding-top: 1px;
                } 
            #tabbar-div p{
                margin:2px 0 0;
            }
            .tab-front{
                background: none repeat scroll 0 0 #BBDDE5;
                border-right: 2px solid #278296;
                cursor:pointer;
                font-weight: bold;
                line-height: 20px;
                padding: 4px 15px 4px 18px;
            }
            .tab-back{
                border-right: 1px solid #fffff;
                color: $fffff;
                cursor: pointer;
                line-height: 20px;
                padding: 4px 15px 4px 18px;
            }
             .tab-hover{
                background: none repeat scroll 0 0 #94c9d3;
                border-right: 1px solid #fffff;
                color: $fffff;
                cursor: pointer;
                line-height: 20px;
                padding: 4px 15px 4px 18px;
            }

        </style>
     
        <script type="text/javascript"> 
        //加载事件里 定义click事件
        $(function(){
            $('.table_a').hide(); //全部table变暗
            $('.table_b').show();  //默认table高亮
            $('#tabbar-div span').click(function(){
                $('#tabbar-div span').attr('class','tab-back');//全部标签变暗
                $(this).attr('class','tab-front'); //当前标签 高亮
 

                $('.table_a').hide(); //全部table变暗
                var idflag = $(this).attr('id');//当前table高亮
                $('#'+idflag+"-tb").show();
            });
        });
        </script>

    </head>

    <body>
        <div id="tabbar-div">
            <p>
                <span id="general-tab" class="tab-front">通用信息</span>
                <span id="detail-tab" class="tab-back">详细描述</span>
                <span id="mix-tab" class="tab-back">其他信息</span>
            </p>
        </div>
       
        <div></div>

        <div style="font-size: 13px;margin: 10px 5px">

            <form action="__SELF__" method="post" enctype="multipart/form-data">
             <table border="1" width="100%" class="table_a" id="detail-tab-tb"><tr>
                 <td>22222222222</td>
             </tr></table>
             </form>
              <table border="1" width="100%" class="table_a" id="mix-tab-tb"><tr>
                 <td>33333333333</td>
             </tr></table>
             </form>

             <form action="__SELF__" method="post" enctype="multipart/form-data">
            <table border="1" width="100%" class="table_a table_b" id="general-tab-tb">
                <tr>
                    <td>111111111</td>
                    <td><input type="text" name="goods_name" />默认table</td>
                </tr>
            </table>
            </form>
        </div>
    </body>
</html>


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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值