mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-17 09:52:29 +01:00
Clarify docs on how tabs are activated from JS, see #1000
This commit is contained in:
parent
cfce34e300
commit
239c178b68
Binary file not shown.
@ -636,9 +636,13 @@ $('#myModal').on('hidden', function () {
|
|||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<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 (each tab needs to be activated individually):</p>
|
||||||
<pre class="prettyprint linenums">$('#myTab').tab('show')</pre>
|
<pre class="prettyprint linenums">
|
||||||
<p>You can select individual tabs in several ways:</p>
|
$('#myTab a').click(function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
$(this).tab('show');
|
||||||
|
})</pre>
|
||||||
|
<p>You can activate individual tabs in several ways:</p>
|
||||||
<pre class="prettyprint linenums">
|
<pre class="prettyprint linenums">
|
||||||
$('#myTab a[href="#profile"]').tab('show'); //Select tab by name
|
$('#myTab a[href="#profile"]').tab('show'); //Select tab by name
|
||||||
$('#myTab a:first').tab('show'); //Select first tab
|
$('#myTab a:first').tab('show'); //Select first tab
|
||||||
|
10
docs/templates/pages/javascript.mustache
vendored
10
docs/templates/pages/javascript.mustache
vendored
@ -560,9 +560,13 @@ $('#myModal').on('hidden', function () {
|
|||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<h2>{{_i}}Using bootstrap-tab.js{{/i}}</h2>
|
<h2>{{_i}}Using bootstrap-tab.js{{/i}}</h2>
|
||||||
<p>{{_i}}Enable tabbable tabs via javascript:{{/i}}</p>
|
<p>{{_i}}Enable tabbable tabs via javascript (each tab needs to be activated individually):{{/i}}</p>
|
||||||
<pre class="prettyprint linenums">$('#myTab').tab('show')</pre>
|
<pre class="prettyprint linenums">
|
||||||
<p>{{_i}}You can select individual tabs in several ways:{{/i}}</p>
|
$('#myTab a').click(function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
$(this).tab('show');
|
||||||
|
})</pre>
|
||||||
|
<p>{{_i}}You can activate individual tabs in several ways:{{/i}}</p>
|
||||||
<pre class="prettyprint linenums">
|
<pre class="prettyprint linenums">
|
||||||
$('#myTab a[href="#profile"]').tab('show'); //Select tab by name
|
$('#myTab a[href="#profile"]').tab('show'); //Select tab by name
|
||||||
$('#myTab a:first').tab('show'); //Select first tab
|
$('#myTab a:first').tab('show'); //Select first tab
|
||||||
|
Loading…
x
Reference in New Issue
Block a user