Skip to content

Commit

Permalink
Fixes #9991: Better docs for tabbable tabs and fade classes
Browse files Browse the repository at this point in the history
* Adds full code snippets
* Adds snippet for `.fade`
* Adds callout for `.in` requirement on first fade-able tab
  • Loading branch information
mdo committed Aug 27, 2013
1 parent 2970653 commit 1445e09
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion javascript.html
Original file line number Diff line number Diff line change
Expand Up @@ -708,15 +708,33 @@ <h2 id="tabs-usage">Usage</h2>
<h3>Markup</h3>
<p>You can activate a tab or pill navigation without writing any JavaScript by simply specifying <code>data-toggle="tab"</code> or <code>data-toggle="pill"</code> on an element. Adding the <code>nav</code> and <code>nav-tabs</code> classes to the tab <code>ul</code> will apply the Bootstrap tab styling.</p>
{% highlight html %}
<!-- Nav tabs -->
<ul class="nav nav-tabs">
<li><a href="#home" data-toggle="tab">Home</a></li>
<li><a href="#profile" data-toggle="tab">Profile</a></li>
<li><a href="#messages" data-toggle="tab">Messages</a></li>
<li><a href="#settings" data-toggle="tab">Settings</a></li>
</ul>

<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active" id="home">...</div>
<div class="tab-pane" id="profile">...</div>
<div class="tab-pane" id="messages">...</div>
<div class="tab-pane" id="settings">...</div>
</div>
{% endhighlight %}

<p>To make tabs fade in, add <code>.fade</code> to each <code>.tab-pane</code>.</p>
<h3>Fade effect</h3>
<p>To make tabs fade in, add <code>.fade</code> to each <code>.tab-pane</code>. The first tab pane must also have <code>.in</code> to properly fade in initial content.</p>
{% highlight html %}
<div class="tab-content">
<div class="tab-pane fade in active" id="home">...</div>
<div class="tab-pane fade" id="profile">...</div>
<div class="tab-pane fade" id="messages">...</div>
<div class="tab-pane fade" id="settings">...</div>
</div>
{% endhighlight %}

<h3>Methods</h3>
<h4>$().tab</h4>
Expand Down

0 comments on commit 1445e09

Please sign in to comment.