返回首页

亲爱的开发者,
我需要在jQuery或JavaScript的TabControl的样本。我需要提高我需要从一个文本框的值复制到另一个点击第二个选项卡时,在jQuery或JavaScript的TabControl,beacause tabchanged事件.. 1框在第一个标签,无法在第二tab.Am的使用Ajax控件。任何样品或编码请...

这是我的编码..单击该选项卡时,会引发按钮的Click事件......但保留在不标签回传...

 <style type="text/css">

        body

        {

            font-family: Verdana, Arial, Helvetica, sans-serif;

        }

        .tab-box

        {

            border-bottom: 1px solid #DDD;

            padding-bottom: 5px;

        }

        .tab-box a

        {

            border: 1px solid #DDD;

            color: #666666;

            padding: 5px 15px;

            text-decoration: none;

            background-color: #eee;

        }

        .tab-box a.activeLink

        {

            background-color: #fff;

            border-bottom: 0;

            padding: 6px 15px;

        }

        .tabcontent

        {

            border: 1px solid #ddd;

            border-top: 0;

            padding: 5px;

        }

        .hide

        {

            display: none;

        }

        

        .small

        {

            color: #999;

            margin-top: 100px;

            border: 1px solid #EEE;

            padding: 5px;

            font-size: 9px;

            font-family: Verdana, Arial, Helvetica, sans-serif;

        }

    </style>

    <script type="text/javascript">

 

        $(document).ready(function () {

            $(".tabLink").each(function () {

                $(this).click(function () {

                    tabeId = $(this).attr('id');

                    $(".tabLink").removeClass("activeLink");

                    $(this).addClass("activeLink");

                    $(".tabcontent").addClass("hide");

                    $("#" + tabeId + "-1").removeClass("hide")

                    alert(tabeId);

                    eval("<%=raja %>");

                    return false;

                });

            });

        });

    </script>

 

<body>

    <form id="form1"  runat="server">

    <div>

        <asp:Button ID="btnNext" runat="server" Text="Next" />

        <div class="tab-box">

            <a href="java<!-- no -->script:;" class="tabLink activeLink" id="cont-1">Tab 1</a> <a href="java<!-- no -->script:;">

                class="tabLink " id="cont-2">Tab 2</a> <a href="java<!-- no -->script:;" class="tabLink " id="cont-3">

                    Tab 3</a>

        </div>

        <div class="tabcontent" id="cont-1-1">

            <asp:TextBox ID="TextBox1" runat="server">

            <asp:Button ID="btn" Text="Save" runat="server" OnClick="btn_Click" />

            This is content box one

        </div>

        <div class="tabcontent hide" id="cont-2-1">

            <asp:TextBox ID="TextBox2" runat="server">

            This is content box Two

        </div>

        <div class="tabcontent hide" id="cont-3-1">

            This is content box Three

        </div>

    </div>

    <asp:HiddenField runat="server" ID="HFCurrTabIndex" />

    </form>

</body>
后面的代码在C#;

{C}
它不工作......

回答

评论会员: 时间:2