显示tbody切换模式(多个表)

时间:2013-12-10 23:10:15

标签: jquery toggle

我对抽签有疑问,

关键是你要默认显示的设计是tbody thead但隐藏在相应的表格中。

我想知道如何显示相应的表格tbody来点击thead A.Link中的链接

有些sugencia?我把我已经完成的代码完成了一半,它只会显示出类似切换的内容。

HTML:

<div class="list">
    <table>
        <thead>
            <tr>
                <th><a href="#" class="link">Bundled Documents List <i class="icon-zoom-in"></i></a></th>
                <th>01/01/2000</th>
                <th><a href="#"><i class="icon-download-alt"></i></a></th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td class="des">Lorem input sum</td>
                <td></td>
                <td></td>
            </tr>
            <tr>
                <td class="des">Executed Builder Contract</td>
                <td></td>
                <td></td>
            </tr>
        </tbody>
    </table>
    <table>
        <thead>
            <tr>
                <th><a href="#" class="link">Bundled Documents List <i class="icon-zoom-in"></i></a>

                </th>
                <th>01/01/2000</th>
                <th><a href="#"><i class="icon-download-alt"></i></a>

                </th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td class="des">Executed Sales Contract</td>
                <td></td>
                <td></td>
            </tr>
            <tr>
                <td class="des">Lorem input sum</td>
                <td></td>
                <td></td>
            </tr>
        </tbody>
    </table>
</div>

jQuery的:

$("div.list thead a.link").click(function (e) {
    e.preventDefault(); // prevents the link from being followed
    $("div.list tbody").show();
});

http://jsfiddle.net/Xqb76/

0 个答案:

没有答案