Bug Tracker

Opened 10 years ago

Last modified 10 years ago

#7916 closed bug

jquert 1.4.4 toggle(fn,fn) on <tr> mistake — at Initial Version

Reported by: shuibiwoku@… Owned by:
Priority: undecided Milestone: 1.next
Component: unfiled Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:

Description

I submitted the mistake is Jquery toggle (fn, fn) function in the table is on the tr fail calls, no hidden and show problem

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>

    <script src="../JQuery/jquery-1.4.4.min.js" type="text/javascript"></script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:TextBox ID="txtUser" runat="server"></asp:TextBox>
        <table>
            <thead>
                <tr>
                    <th>
                        姓名
                    </th>
                    <th>
                        性别
                    </th>
                    <th>
                        暂住地
                    </th>
                </tr>
            </thead>
            <tbody>
                <tr class="parent" id="row_01">
                    <td colspan="3">
                        前台设计组
                    </td>
                </tr>
                <tr class="child_row_01">
                    <td>
                        张三
                    </td>
                    <td>
                        男
                    </td>
                    <td>
                        浙江宁波
                    </td>
                </tr>
                <tr class="child_row_01">
                    <td>
                        李四
                    </td>
                    <td>
                        女
                    </td>
                    <td>
                        浙江杭州
                    </td>
                </tr>
                <tr class="parent" id="row_02">
                    <td colspan="3">
                        前台开发组
                    </td>
                </tr>
                <tr class="child_row_02">
                    <td>
                        王五
                    </td>
                    <td>
                        男
                    </td>
                    <td>
                        湖南长沙
                    </td>
                </tr>
                <tr class="child_row_02">
                    <td>
                        赵六
                    </td>
                    <td>
                        男
                    </td>
                    <td>
                        浙江温州
                    </td>
                </tr>
                <tr class="parent" id="row_03">
                    <td colspan="3">
                        后台开发组
                    </td>
                </tr>
                <tr class="child_row_03">
                    <td>
                        Rain
                    </td>
                    <td>
                        男
                    </td>
                    <td>
                        浙江杭州
                    </td>
                </tr>
                <tr class="child_row_03">
                    <td>
                        MaxMan
                    </td>
                    <td>
                        女
                    </td>
                    <td>
                        浙江杭州
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
    </form>
</body>
</html>

$(function() {

$("tr.parent").click(function() {

var trs = $(this).siblings(".child_" + this.id);

trs.toggle(function() { trs.hide("normal"); }, function() {

trs.show("normal");

});

});

});

Change History (0)

Note: See TracTickets for help on using tickets.