Commit cfce34e3 authored by Marcus Bointon's avatar Marcus Bointon

Add more examples for activating tabs

Make naming of tab id consistent
parent 2f063663
...@@ -609,7 +609,7 @@ $('#myModal').on('hidden', function () { ...@@ -609,7 +609,7 @@ $('#myModal').on('hidden', function () {
<div class="span9 columns"> <div class="span9 columns">
<h2>Example tabs</h2> <h2>Example tabs</h2>
<p>Click the tabs below to toggle between hidden panes, even via dropdown menus.</p> <p>Click the tabs below to toggle between hidden panes, even via dropdown menus.</p>
<ul id="tab" class="nav nav-tabs"> <ul id="myTab" class="nav nav-tabs">
<li class="active"><a href="#home" data-toggle="tab">Home</a></li> <li class="active"><a href="#home" data-toggle="tab">Home</a></li>
<li><a href="#profile" data-toggle="tab">Profile</a></li> <li><a href="#profile" data-toggle="tab">Profile</a></li>
<li class="dropdown"> <li class="dropdown">
...@@ -638,10 +638,12 @@ $('#myModal').on('hidden', function () { ...@@ -638,10 +638,12 @@ $('#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> <p>You can select individual tabs in several ways:</p>
<pre class="prettyprint linenums"> <pre class="prettyprint linenums">
$('#myTab a[href="#profile"]').tab('show'); $('#myTab a[href="#profile"]').tab('show'); //Select tab by name
$('#myTab a:last').tab('show'); $('#myTab a:first').tab('show'); //Select first tab
$('#myTab a:last').tab('show'); //Select last tab
$('#myTab li:eq(2) a').tab('show'); //Select third tab (0-indexed)
</pre> </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. Adding the <code>nav</code> and <code>nav-tabs</code> classes to the tab <code>ul</code> will apply the bootstrap tab styling.</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. Adding the <code>nav</code> and <code>nav-tabs</code> classes to the tab <code>ul</code> will apply the bootstrap tab styling.</p>
......
...@@ -533,7 +533,7 @@ $('#myModal').on('hidden', function () { ...@@ -533,7 +533,7 @@ $('#myModal').on('hidden', function () {
<div class="span9 columns"> <div class="span9 columns">
<h2>{{_i}}Example tabs{{/i}}</h2> <h2>{{_i}}Example tabs{{/i}}</h2>
<p>{{_i}}Click the tabs below to toggle between hidden panes, even via dropdown menus.{{/i}}</p> <p>{{_i}}Click the tabs below to toggle between hidden panes, even via dropdown menus.{{/i}}</p>
<ul id="tab" class="nav nav-tabs"> <ul id="myTab" class="nav nav-tabs">
<li class="active"><a href="#home" data-toggle="tab">{{_i}}Home{{/i}}</a></li> <li class="active"><a href="#home" data-toggle="tab">{{_i}}Home{{/i}}</a></li>
<li><a href="#profile" data-toggle="tab">{{_i}}Profile{{/i}}</a></li> <li><a href="#profile" data-toggle="tab">{{_i}}Profile{{/i}}</a></li>
<li class="dropdown"> <li class="dropdown">
...@@ -562,10 +562,12 @@ $('#myModal').on('hidden', function () { ...@@ -562,10 +562,12 @@ $('#myModal').on('hidden', function () {
<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:{{/i}}</p>
<pre class="prettyprint linenums">$('#myTab').tab('show')</pre> <pre class="prettyprint linenums">$('#myTab').tab('show')</pre>
<p>{{_i}}You can also activate a specific tab (or a pseudo-selected one) on init:{{/i}}</p> <p>{{_i}}You can select individual tabs in several ways:{{/i}}</p>
<pre class="prettyprint linenums"> <pre class="prettyprint linenums">
$('#myTab a[href="#profile"]').tab('show'); $('#myTab a[href="#profile"]').tab('show'); //Select tab by name
$('#myTab a:last').tab('show'); $('#myTab a:first').tab('show'); //Select first tab
$('#myTab a:last').tab('show'); //Select last tab
$('#myTab li:eq(2) a').tab('show'); //Select third tab (0-indexed)
</pre> </pre>
<h3>{{_i}}Markup{{/i}}</h3> <h3>{{_i}}Markup{{/i}}</h3>
<p>{{_i}}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. Adding the <code>nav</code> and <code>nav-tabs</code> classes to the tab <code>ul</code> will apply the bootstrap tab styling.{{/i}}</p> <p>{{_i}}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. Adding the <code>nav</code> and <code>nav-tabs</code> classes to the tab <code>ul</code> will apply the bootstrap tab styling.{{/i}}</p>
......
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