Bootstrap Tutorial - fade tab pane








The following code shows how to fade tab pane.

Example

<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-1.8.3.js'></script>
<script type='text/javascript'
  src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css"
  href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css">
</head><!-- w  ww.  j av a  2  s  . c om-->
<body>
  <div class="my-example">
    <ul id="myTab" class="nav nav-tabs">
      <li class=""><a href="#home" data-toggle="tab">Home</a></li>
      <li class=""><a href="#profile" data-toggle="tab">Profile</a></li>
      <li class="dropdown active"><a href="#" class="dropdown-toggle"
        data-toggle="dropdown">Dropdown <b class="caret"></b></a>
        <ul class="dropdown-menu">
          <li class="active">
          <a href="#dropdown1" data-toggle="tab">t</a></li>
          <li><a href="#dropdown2" data-toggle="tab">a</a></li>
        </ul></li>
    </ul>
    <div id="myTabContent" class="tab-content">
      <div class="tab-pane fade" id="home">
        <p>Raw denim you probably haven't heard of them jean shorts
          Austin.</p>
        <p style="display: none">mytext1</p>
      </div>
      <div class="tab-pane fade" id="profile">
        <p>Food truck fixie locavore, accusamus mcsweeney's marfa nulla
          single-origin coffee squid.</p>
        <p style="display: none">mytext2</p>
      </div>
      <div class="tab-pane fade active in" id="dropdown1">
        <p>Etsy mixtape wayfarers, ethical wes anderson tofu before they
          sold out mcsweeney's organic lomo retro fanny pack lo-fi
          farm-to-table readymade.</p>
        <p style="display: none">mytext3</p>
      </div>
      <div class="tab-pane fade" id="dropdown2">
        <p>Trust fund seitan letterpress, keytar raw denim keffiyeh etsy
          art party before they sold out master cleanse gluten-free squid
          scenester freegan cosby sweater.</p>
        <p style="display: none">mytext4</p>
      </div>
    </div>
    <button onclick="sendTextToServer('aaaa')" id="sendButton"
      status="initial">Send now</button>
  </div>
</body>
</html>

Click to view the demo