aboutsummaryrefslogtreecommitdiff
path: root/docs/javascript.html
diff options
context:
space:
mode:
authorMarcus Bointon <[email protected]>2012-03-21 11:20:56 +0100
committerMarcus Bointon <[email protected]>2012-03-21 11:20:56 +0100
commita0203bc8e0aa79b8f8cfd8c082c4256bed29ae5b (patch)
tree74578458eb8366485cfe94c31c36c2bfdd619977 /docs/javascript.html
parent59503e71ff06d0fd065c2fb981f55f4651ebc274 (diff)
downloadbootstrap-a0203bc8e0aa79b8f8cfd8c082c4256bed29ae5b.tar.xz
bootstrap-a0203bc8e0aa79b8f8cfd8c082c4256bed29ae5b.zip
Fix and improve docs on tab config
Diffstat (limited to 'docs/javascript.html')
-rw-r--r--docs/javascript.html9
1 files changed, 7 insertions, 2 deletions
diff --git a/docs/javascript.html b/docs/javascript.html
index a90562767..739e2475f 100644
--- a/docs/javascript.html
+++ b/docs/javascript.html
@@ -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>