0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-01-17 09:52:29 +01:00

Fix and improve docs on tab config

This commit is contained in:
Marcus Bointon 2012-03-21 11:20:56 +01:00
parent 59503e71ff
commit a0203bc8e0

View File

@ -638,6 +638,11 @@ $('#myModal').on('hidden', function () {
<h2>Using bootstrap-tab.js</h2>
<p>Enable tabbable tabs via javascript:</p>
<pre class="prettyprint linenums">$('#myTab').tab('show')</pre>
<p>You can also activate a specific tab (or a pseudo-selected one) on init:</p>
<pre class="prettyprint linenums">
$('#myTab a[href="#profile"]').tab('show');
$('#myTab a:last').tab('show');
</pre>
<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.</p>
<pre class="prettyprint linenums">
@ -653,7 +658,7 @@ $('#myModal').on('hidden', function () {
Activates a tab element and content container. Tab should have either a `data-target` or an `href` targeting a container node in the dom.
</p>
<pre class="prettyprint linenums">
&lt;ul class="nav nav-tabs"&gt;
&lt;ul class="nav nav-tabs" id="myTab"&gt;
&lt;li class="active"&gt;&lt;a href="#home"&gt;Home&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#profile"&gt;Profile&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#messages"&gt;Messages&lt;/a&gt;&lt;/li&gt;
@ -669,7 +674,7 @@ $('#myModal').on('hidden', function () {
&lt;script&gt;
$(function () {
$('.tabs a:last').tab('show')
$('#myTab a:last').tab('show')
})
&lt;/script&gt;</pre>
<h3>Events</h3>