我有一個jQuery選項卡。在第三個選項卡中單擊og按鈕時,選項卡將控件移動到第一個選項卡。我試了很多辦法像ASP隱藏字段和存儲當前選項卡沒有工作jQuery選項卡無法保留活動標籤,而回發
<div id="tabwrap">
<ul id="tabs">
<li><a href="#tabs-1" class="current">Attribute Based Control</a></li>
<li><a href="#tabs-2">Role Based Control</a></li>
<li id="tab3"><a href="#tabs-3">Users</a></li>
</ul>
<div id="content">
<div id="tabs-1" class="tab-section">
</div>
<div id="tabs-2" class="tab-section">
</div>
<div id="tabs-3" class="tab-section">
<asp:Button ID="btnSearch" runat="server" Text="Submit" CssClass="buttonsmallRight" Visible="false" ClientIDMode="Static" />
</div>
</div>
的jQuery的標籤
$(function() {
$('.tab-section').hide();
$('#tabs a').bind('click', function (e) {
$('#tabs a.current').removeClass('current');
$('.tab-section:visible').hide();
$(this.hash).show();
$(this).addClass('current');
e.preventDefault();
}).filter(':first').click();
});
CSS的jQuery
#tabs {
margin: 0;
overflow: hidden;
padding: 0;
zoom: 1;
position: relative;
top: 2px;
z-index: 1;
margin-left: -500px;
}
#tabs li {
display: block;
list-style: none;
margin: 0;
margin-right: 1px;
padding: 0;
float: left;
text-align: center;
}
#tabs li a {
display: block;
padding: 2px 10px;
border: 2px solid #808080;
border-bottom: 0 none;
text-align: center;
text-decoration: none;
border-bottom: 1px gray;
/*background-color: #d4efff;*/
background-color: #d6d7e4;
height: 22px;
font-size: 16px;
width: 150px;
}
#tab-section {
background: #A59CFF;
padding: 10px;
border: 2px solid #6161f3;
margin-left: -700px;
width: 926px;
}
#tabs li a.current {
background: #A59CFF;
color: white;
border-bottom: 2px solid #A59CFF;
height: 22px;
font-size: 16px;
text-align: center;
}