Commit 34382708 authored by Chris Rebert's avatar Chris Rebert
Browse files

Properly document $(...).tab('show') method; fixes #16115

[skip sauce]
parent 1bafd4c8
5 merge requests!28721Hot test,!16156Properly document $(...).tab('show') method,!16605Test pull please ignore,!22103test,!25326Adjust examples
Showing with 4 additions and 21 deletions
+4 -21
...@@ -94,29 +94,12 @@ $('#myTabs li:eq(2) a').tab('show') // Select third tab (0-indexed) ...@@ -94,29 +94,12 @@ $('#myTabs li:eq(2) a').tab('show') // Select third tab (0-indexed)
<h3 id="tabs-methods">Methods</h3> <h3 id="tabs-methods">Methods</h3>
<h4><code>$().tab</code></h4> <h4><code>$().tab</code></h4>
<p> <p>
Activates a tab element and content container. Tab should have either a <code>data-target</code> or an <code>href</code> targeting a container node in the DOM. Activates a tab element and content container. Tab should have either a <code>data-target</code> or an <code>href</code> targeting a container node in the DOM. In the above examples, the tabs are the <code>&lt;a&gt;</code>s with <code>data-toggle="tab"</code> attributes.
</p> </p>
{% highlight html %}
<ul class="nav nav-tabs" role="tablist" id="myTabs">
<li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">Home</a></li>
<li role="presentation"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">Profile</a></li>
<li role="presentation"><a href="#messages" aria-controls="messages" role="tab" data-toggle="tab">Messages</a></li>
<li role="presentation"><a href="#settings" aria-controls="settings" role="tab" data-toggle="tab">Settings</a></li>
</ul>
<div class="tab-content"> <h4><code>.tab('show')</code></h4>
<div role="tabpanel" class="tab-pane active" id="home">...</div> <p>Selects the given tab and shows its associated content. Any other tab that was previously selected becomes unselected and its associated content is hidden.</p>
<div role="tabpanel" class="tab-pane" id="profile">...</div> {% highlight js %}$('#someTab').tab('show'){% endhighlight %}
<div role="tabpanel" class="tab-pane" id="messages">...</div>
<div role="tabpanel" class="tab-pane" id="settings">...</div>
</div>
<script>
$(function () {
$('#myTabs a:last').tab('show')
})
</script>
{% endhighlight %}
<h3 id="tabs-events">Events</h3> <h3 id="tabs-events">Events</h3>
<p>When showing a new tab, the events fire in the following order:</p> <p>When showing a new tab, the events fire in the following order:</p>
......
Supports Markdown
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