mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-18 10:52:19 +01:00
Fix and improve docs on tab config
This commit is contained in:
parent
59503e71ff
commit
a0203bc8e0
@ -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 () {
|
|||||||
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">
|
||||||
<ul class="nav nav-tabs">
|
<ul class="nav nav-tabs" id="myTab">
|
||||||
<li class="active"><a href="#home">Home</a></li>
|
<li class="active"><a href="#home">Home</a></li>
|
||||||
<li><a href="#profile">Profile</a></li>
|
<li><a href="#profile">Profile</a></li>
|
||||||
<li><a href="#messages">Messages</a></li>
|
<li><a href="#messages">Messages</a></li>
|
||||||
@ -669,7 +674,7 @@ $('#myModal').on('hidden', function () {
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(function () {
|
$(function () {
|
||||||
$('.tabs a:last').tab('show')
|
$('#myTab a:last').tab('show')
|
||||||
})
|
})
|
||||||
</script></pre>
|
</script></pre>
|
||||||
<h3>Events</h3>
|
<h3>Events</h3>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user