diff options
| author | Marcus Bointon <[email protected]> | 2012-03-21 11:20:56 +0100 |
|---|---|---|
| committer | Marcus Bointon <[email protected]> | 2012-03-21 11:20:56 +0100 |
| commit | a0203bc8e0aa79b8f8cfd8c082c4256bed29ae5b (patch) | |
| tree | 74578458eb8366485cfe94c31c36c2bfdd619977 /docs/javascript.html | |
| parent | 59503e71ff06d0fd065c2fb981f55f4651ebc274 (diff) | |
| download | bootstrap-a0203bc8e0aa79b8f8cfd8c082c4256bed29ae5b.tar.xz bootstrap-a0203bc8e0aa79b8f8cfd8c082c4256bed29ae5b.zip | |
Fix and improve docs on tab config
Diffstat (limited to 'docs/javascript.html')
| -rw-r--r-- | docs/javascript.html | 9 |
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"> -<ul class="nav nav-tabs"> +<ul class="nav nav-tabs" id="myTab"> <li class="active"><a href="#home">Home</a></li> <li><a href="#profile">Profile</a></li> <li><a href="#messages">Messages</a></li> @@ -669,7 +674,7 @@ $('#myModal').on('hidden', function () { <script> $(function () { - $('.tabs a:last').tab('show') + $('#myTab a:last').tab('show') }) </script></pre> <h3>Events</h3> |
