管理杂谈OA答疑ERP答疑教程搜索

基于表格的 Tab


这是一个基于表格的tab,比较传统的方式完成的,配合了javascript技术,不懂css的朋友正好 可以适合您,没有用到css因此也就可以不考虑兼容性问题,在其它浏览器下也表现良好。

<title>

    基于表格的tab

</title>


<meta http-equiv="content-type" content="text/html; charset=gb2312"/>

<script language="javascript">

function tabit(id,cid) {

tabwoman.classname="taboff";

tabman.classname="taboff";

tabsport.classname="taboff";

tableisure.classname="taboff";

tabshoes.classname="taboff";

tabdecor.classname="taboff";

id.classname="tabon";

cwoman.style.display="none";

cman.style.display="none";

csport.style.display="none";

cleisure.style.display="none";

cshoes.style.display="none";

cdecor.style.display="none";

cid.style.display="block";

}


function showall() {

tabwoman.classname="tabon";

tabman.classname="tabon";

tabsport.classname="tabon";

tableisure.classname="tabon";

tabshoes.classname="tabon";

tabdecor.classname="tabon";

cwoman.style.display="block";

cman.style.display="block";

csport.style.display="block";

cleisure.style.display="block";

cshoes.style.display="block";

cdecor.style.display="block";

}

</script>

<style>

td {

 font-family: "verdana"; 

 padding:3px;

}

 

.tabon {

 border-top: 1px solid #e3e3e3;border-left: 1px solid #e3e3e3;

 color: #db5b6f;

 font-weight: bold;

}

 

.taboff {

 background-color: #f5f5f5;

 border-top: 1px solid #e3e3e3;border-left: 1px solid #e3e3e3;border-bottom: 1px solid #e3e3e3;

 color: #666666;

 font-weight: bold;

}

 

.tdbody {

 border-bottom: 1px solid #e3e3e3;border-right: 1px solid #e3e3e3;border-left: 1px solid #e3e3e3;

 line-height:50px;

}

 

.tdbody2 {

 border-right: 1px solid #e3e3e3;border-left: 1px solid #e3e3e3;

 line-height:50px;

}

</style>

<table border="0" cellpadding="0" cellspacing="0" width="340">

    <tbody>

        <tr>

            <td class="taboff" id="tabwoman" style="cursor:hand" onclick="tabit(tabwoman,cwoman)" align="center">

                asp

            </td>

            <td class="taboff" id="tabman" style="cursor:hand" onclick="tabit(tabman,cman)" align="center">

                php

            </td>

            <td class="taboff" id="tabsport" style="cursor:hand" onclick="tabit(tabsport,csport)" align="center">

                asp.net

            </td>

            <td class="taboff" id="tableisure" style="cursor:hand" onclick="tabit(tableisure,cleisure)" align="center">

                vc++

            </td>

            <td class="taboff" id="tabshoes" style="cursor:hand" onclick="tabit(tabshoes,cshoes)" align="center">

                vb

            </td>

            <td class="taboff" id="tabdecor" style="cursor:hand" onclick="tabit(tabdecor,cdecor)" align="center">

                ajax

            </td>

        </tr>

        <tr id="cwoman" style="display:none">

            <td colspan="6" class="tdbody">

                <a href="#">asp</a>

            </td>

        </tr>

        <tr id="cman" style="display:none">

            <td colspan="6" class="tdbody">

                <a href="#">php</a>

            </td>

        </tr>

        <tr id="csport" style="display:none">

            <td colspan="6" class="tdbody">

                <a href="#">asp.net</a>

            </td>

        </tr>

        <tr id="cleisure" style="display:none">

            <td colspan="6" class="tdbody">

                <a href="#">vc++</a>

            </td>

        </tr>

        <tr id="cshoes" style="display:none">

            <td colspan="6" class="tdbody">

                <a href="#">vb</a>

            </td>

        </tr>

        <tr id="cdecor" style="display:none">

            <td colspan="6" class="tdbody">

                <a href="#">ajax</a>

            </td>

        </tr>

    </tbody>

</table>


更多精彩文章浏览...
点击右上角图标分享到朋友圈
官方网站:http://www.clicksun.cn
咨询热线:400-186-1886
服务邮箱:service@clicksun.cn