-2

我有三个按钮和三个面板。我单击按钮面板 1 仅在当时加载,面板 2 和 3 是不可见的。如果我单击按钮 2 面板 2 加载,面板 1 和 3 是不可见的。我想改变我的按钮样式,如选项卡的选项卡容器。这些三个按钮喜欢显示 tabs.is 可能在 css with asp.net 中吗?

4

1 回答 1

1

您可以使用Togglable tabs的概念

<link href="assets/css/bootstrap.css" rel="stylesheet">
<link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="assets/js/bootstrap-transition.js"></script>
<script src="assets/js/bootstrap-tab.js"></script>
<script>
$('#panel a').click(function(e) {
  e.preventDefault();
  $(this).tab('show');
})

// first active
$('#panel a:first').tab('show');
</script>

<div class="tabbable">
<ul id="panel" class="nav nav-tabs">
  <li><a href="#button1" data-toggle="tab">Button 1</a></li>
  <li><a href="#button2" data-toggle="tab">Button 2</a></li>
  <li><a href="#button3" data-toggle="tab">Button 3</a></li>
</ul>
<div class="tab-content">
  <div class="tab-pane fade in active" id="button1">
     You have click button 1 and show a panel 1 </div>
  <div class="tab-pane fade in " id="button2">You have click button 2 and show a panel 2</div>
  <div class="tab-pane fade in " id="button3">You have click button 3 and show a panel 3 </div> 
</div>

这是演示:jsfiddle

于 2013-05-21T13:44:38.410 回答