Commit a0203bc8 authored by Marcus Bointon's avatar Marcus Bointon

Fix and improve docs on tab config

parent 59503e71
...@@ -638,6 +638,11 @@ $('#myModal').on('hidden', function () { ...@@ -638,6 +638,11 @@ $('#myModal').on('hidden', function () {
<h2>Using bootstrap-tab.js</h2> <h2>Using bootstrap-tab.js</h2>
<p>Enable tabbable tabs via javascript:</p> <p>Enable tabbable tabs via javascript:</p>
<pre class="prettyprint linenums">$('#myTab').tab('show')</pre> <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> <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> <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"> <pre class="prettyprint linenums">
...@@ -653,7 +658,7 @@ $('#myModal').on('hidden', function () { ...@@ -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. 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> </p>
<pre class="prettyprint linenums"> <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 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="#profile"&gt;Profile&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#messages"&gt;Messages&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 () { ...@@ -669,7 +674,7 @@ $('#myModal').on('hidden', function () {
&lt;script&gt; &lt;script&gt;
$(function () { $(function () {
$('.tabs a:last').tab('show') $('#myTab a:last').tab('show')
}) })
&lt;/script&gt;</pre> &lt;/script&gt;</pre>
<h3>Events</h3> <h3>Events</h3>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment