From a0203bc8e0aa79b8f8cfd8c082c4256bed29ae5b Mon Sep 17 00:00:00 2001 From: Marcus Bointon Date: Wed, 21 Mar 2012 11:20:56 +0100 Subject: Fix and improve docs on tab config --- docs/javascript.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'docs/javascript.html') diff --git a/docs/javascript.html b/docs/javascript.html index a90562767..739e2475f 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -638,6 +638,11 @@ $('#myModal').on('hidden', function () {

Using bootstrap-tab.js

Enable tabbable tabs via javascript:

$('#myTab').tab('show')
+

You can also activate a specific tab (or a pseudo-selected one) on init:

+
+$('#myTab a[href="#profile"]').tab('show');
+$('#myTab a:last').tab('show');
+

Markup

You can activate a tab or pill navigation without writing any javascript by simply specifying data-toggle="tab" or data-toggle="pill" on an element.

@@ -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.
           

-<ul class="nav nav-tabs">
+<ul class="nav nav-tabs" id="myTab">
   <li class="active"><a href="#home">Home</a></li>
   <li><a href="#profile">Profile</a></li>
   <li><a href="#messages">Messages</a></li>
@@ -669,7 +674,7 @@ $('#myModal').on('hidden', function () {
 
 <script>
   $(function () {
-    $('.tabs a:last').tab('show')
+    $('#myTab a:last').tab('show')
   })
 </script>

Events

-- cgit v1.2.3 From 02a67ea59eb8ee28ba4220898c1a0b2052a80915 Mon Sep 17 00:00:00 2001 From: Marcus Bointon Date: Wed, 21 Mar 2012 11:28:23 +0100 Subject: Add note about styling tabs Fix typo in popover docs --- docs/javascript.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/javascript.html') diff --git a/docs/javascript.html b/docs/javascript.html index 739e2475f..c9b94a3ca 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -644,7 +644,7 @@ $('#myTab a[href="#profile"]').tab('show'); $('#myTab a:last').tab('show');

Markup

-

You can activate a tab or pill navigation without writing any javascript by simply specifying data-toggle="tab" or data-toggle="pill" on an element.

+

You can activate a tab or pill navigation without writing any javascript by simply specifying data-toggle="tab" or data-toggle="pill" on an element. Adding the nav and nav-tabs classes to the tab ul will apply the bootstrap tab styling.

 <ul class="nav nav-tabs">
   <li><a href="#home" data-toggle="tab">Home</a></li>
@@ -898,7 +898,7 @@ $('a[data-toggle="tab"]').on('shown', function (e) {
           
           

Markup

- For performance reasons, the Tooltip and Popover data-apis are opt in. If you would like to use them just specify a the selector option. + For performance reasons, the Tooltip and Popover data-apis are opt in. If you would like to use them just specify a selector option.

Methods

$().popover(options)

-- cgit v1.2.3 From cfce34e3000b2c02549e3af280668afea61fa752 Mon Sep 17 00:00:00 2001 From: Marcus Bointon Date: Thu, 22 Mar 2012 20:36:49 +0100 Subject: Add more examples for activating tabs Make naming of tab id consistent --- docs/javascript.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'docs/javascript.html') diff --git a/docs/javascript.html b/docs/javascript.html index c9b94a3ca..f2d23ef52 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -609,7 +609,7 @@ $('#myModal').on('hidden', function () {

Example tabs

Click the tabs below to toggle between hidden panes, even via dropdown menus.

-

Using bootstrap-tab.js

-

Enable tabbable tabs via javascript:

-
$('#myTab').tab('show')
-

You can select individual tabs in several ways:

+

Enable tabbable tabs via javascript (each tab needs to be activated individually):

+
+$('#myTab a').click(function (e) {
+  e.preventDefault();
+  $(this).tab('show');
+})
+

You can activate individual tabs in several ways:

 $('#myTab a[href="#profile"]').tab('show'); //Select tab by name
 $('#myTab a:first').tab('show'); //Select first tab
-- 
cgit v1.2.3