From a404ac33bb9e78323b84d0840735445579634b9e Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Wed, 16 May 2012 19:09:57 -0700 Subject: modal accessibility tab control --- docs/javascript.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'docs/javascript.html') diff --git a/docs/javascript.html b/docs/javascript.html index 7ad42ae81..3a1f151cd 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -223,8 +223,9 @@

Live demo

Toggle a modal via javascript by clicking the button below. It will slide down and fade in from the top of the page.

+ -
-<button class="btn btn-danger" data-toggle="collapse" data-target="#demo">
+<button type="button" class="btn btn-danger" data-toggle="collapse" data-target="#demo">
   simple collapsible
 </button>
 
-- 
cgit v1.2.3


From 5f861ef51735d8b0f2c0f0faf8f438808a480d99 Mon Sep 17 00:00:00 2001
From: Mark Otto 
Date: Sat, 7 Jul 2012 23:16:07 -0700
Subject: fix up docs to use default container, fix responsive home changes

---
 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 62e046b1c..b321e6632 100644
--- a/docs/javascript.html
+++ b/docs/javascript.html
@@ -33,7 +33,7 @@
     ================================================== -->
     
 
-
+
 
      
-- 
cgit v1.2.3


From 3c775f24323d649f55aaa175eb6a1a19024ab30c Mon Sep 17 00:00:00 2001
From: Mark Otto 
Date: Thu, 12 Jul 2012 16:23:21 -0700
Subject: add chevrons to other docs navs

---
 docs/javascript.html | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

(limited to 'docs/javascript.html')

diff --git a/docs/javascript.html b/docs/javascript.html
index 43b0ca711..0b475ae3b 100644
--- a/docs/javascript.html
+++ b/docs/javascript.html
@@ -82,19 +82,19 @@
 
-- cgit v1.2.3 From 549d61fc289cb9efe5f8959e706e170b080663ba Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Thu, 12 Jul 2012 17:02:55 -0700 Subject: updated footer --- docs/javascript.html | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'docs/javascript.html') diff --git a/docs/javascript.html b/docs/javascript.html index 0b475ae3b..1792f75c4 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -1588,10 +1588,14 @@ $('.carousel').carousel({
+ + - - -- cgit v1.2.3 From a12f0e551f7da763a9be23013d1b51c161a0f6f8 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Thu, 12 Jul 2012 18:11:49 -0700 Subject: overhaul docs on sub pages, clean up css and copy --- docs/javascript.html | 2375 +++++++++++++++++++++++++------------------------- 1 file changed, 1190 insertions(+), 1185 deletions(-) (limited to 'docs/javascript.html') diff --git a/docs/javascript.html b/docs/javascript.html index 1792f75c4..21d0044b0 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -66,112 +66,113 @@ -
-
-

Javascript for Bootstrap

-

Bring Bootstrap's components to life—now with 12 custom jQuery plugins. +

+

Javascript for Bootstrap

+

Bring Bootstrap's components to life—now with 12 custom jQuery plugins. +

- - - -
- -
+
+ + + +
+ +
- -
- + +
+ -

Individual or compiled

-

If you have downloaded the latest version of Bootstrap, both bootstrap.js and bootstrap.min.js contain all of these plugins.

+

Individual or compiled

+

If you have downloaded the latest version of Bootstrap, both bootstrap.js and bootstrap.min.js contain all of these plugins.

-

Data attributes

-

...

+

Data attributes

+

...

-

Programmatic API

-

...

+

Programmatic API

+

...

-
+
- -
- -

About transitions

-

For simple transition effects, include bootstrap-transition.js once alongside the other JS files. If you're using the compiled (or minified) bootstrap.js, there is no need to include this—it's already there.

-

Use cases

-

A few examples of the transition plugin:

-
    -
  • Sliding or fading in modals
  • -
  • Fading out tabs
  • -
  • Fading out alerts
  • -
  • Sliding carousel panes
  • -
+ +
+ +

About transitions

+

For simple transition effects, include bootstrap-transition.js once alongside the other JS files. If you're using the compiled (or minified) bootstrap.js, there is no need to include this—it's already there.

+

Use cases

+

A few examples of the transition plugin:

+
    +
  • Sliding or fading in modals
  • +
  • Fading out tabs
  • +
  • Fading out alerts
  • +
  • Sliding carousel panes
  • +
-
+
- -
- + +
+ -

Examples

-

Modals are streamlined, but flexible, dialog prompts with the minimum required functionality and smart defaults.

+

Examples

+

Modals are streamlined, but flexible, dialog prompts with the minimum required functionality and smart defaults.

-

Static example

-

A rendered modal with header, body, and set of actions in the footer.

-
-
+}) +
+ - - - -
- + +
+ -

Example in navbar

-

The ScrollSpy plugin is for automatically updating nav targets based on scroll position. Scroll the area below the navbar and watch the active class change. The dropdown sub items will be highlighted as well.

-
-
- - - - -
- +

Options

+

Options can be passed via data attributes or javascript. For data attributes, append the option name to data-, as in data-offset="".

+ + + + + + + + + + + + + + + + + +
Nametypedefaultdescription
offsetnumber10Pixels to offset from top when calculating position of scroll.
+ +

Events

+ + + + + + + + + + + + + +
EventDescription
activateThis event fires whenever a new item becomes activated by the scrollspy.
+
+ + + + +
+ -

Example tabs

-

Add quick, dynamic tab functionality to transiton through panes of local content, even via dropdown menus.

-
- -
-
-

Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.

-
-
-

Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.

-
- - -
+
-

Usage

-

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

+

Usage

+

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:

+

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
@@ -661,8 +663,8 @@ $('#myTab a:last').tab('show'); // Select last tab
 $('#myTab li:eq(2) a').tab('show'); // Select third tab (0-indexed)
 
-

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. Adding the nav and nav-tabs classes to the tab ul will apply the bootstrap tab styling.

+

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. 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>
@@ -671,11 +673,11 @@ $('#myTab li:eq(2) a').tab('show'); // Select third tab (0-indexed)
   <li><a href="#settings" data-toggle="tab">Settings</a></li>
 </ul>
-

Methods

-

$().tab

-

- Activates a tab element and content container. Tab should have either a data-target or an href targeting a container node in the DOM. -

+

Methods

+

$().tab

+

+ 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" id="myTab">
   <li class="active"><a href="#home">Home</a></li>
@@ -695,429 +697,432 @@ $('#myTab li:eq(2) a').tab('show'); // Select third tab (0-indexed)
   $(function () {
     $('#myTab a:last').tab('show');
   })
-</script>
+</script> + -

Events

- - - - - - - - - - - - - - - - - -
EventDescription
showThis event fires on tab show, but before the new tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively.
shownThis event fires on tab show after a tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively.
+

Events

+ + + + + + + + + + + + + + + + + +
EventDescription
showThis event fires on tab show, but before the new tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively.
shownThis event fires on tab show after a tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively.
 $('a[data-toggle="tab"]').on('shown', function (e) {
   e.target // activated tab
   e.relatedTarget // previous tab
-})
-
+}) + +
- -
- + +
+ -

Examples

-

Inspired by the excellent jQuery.tipsy plugin written by Jason Frame; Tooltips are an updated version, which don't rely on images, use CSS3 for animations, and data-attributes for local title storage.

-

Hover over the links below to see tooltips:

-
-

Tight pants next level keffiyeh you probably haven't heard of them. Photo booth beard raw denim letterpress vegan messenger bag stumptown. Farm-to-table seitan, mcsweeney's fixie sustainable quinoa 8-bit american apparel have a terry richardson vinyl chambray. Beard stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, four loko mcsweeney's cleanse vegan chambray. A really ironic artisan whatever keytar, scenester farm-to-table banksy Austin twitter handle freegan cred raw denim single-origin coffee viral. -

-
+

Examples

+

Inspired by the excellent jQuery.tipsy plugin written by Jason Frame; Tooltips are an updated version, which don't rely on images, use CSS3 for animations, and data-attributes for local title storage.

+

Hover over the links below to see tooltips:

+
+

Tight pants next level keffiyeh you probably haven't heard of them. Photo booth beard raw denim letterpress vegan messenger bag stumptown. Farm-to-table seitan, mcsweeney's fixie sustainable quinoa 8-bit american apparel have a terry richardson vinyl chambray. Beard stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, four loko mcsweeney's cleanse vegan chambray. A really ironic artisan whatever keytar, scenester farm-to-table banksy Austin twitter handle freegan cred raw denim single-origin coffee viral. +

+
-

Four directions

- +

Four directions

+ -
- - -

Usage

-

Trigger the tooltip via javascript:

-
$('#example').tooltip(options)
- -

Options

-

Options can be passed via data attributes or javascript. For data attributes, append the option name to data-, as in data-animation="".

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Nametypedefaultdescription
animationbooleantrueapply a css fade transition to the tooltip
htmlbooleantrueInsert html into the tooltip. If false, jquery's text method will be used to insert content into the dom. Use text if you're worried about XSS attacks.
placementstring|function'top'how to position the tooltip - top | bottom | left | right
selectorstringfalseIf a selector is provided, tooltip objects will be delegated to the specified targets.
titlestring | function''default title value if `title` tag isn't present
triggerstring'hover'how tooltip is triggered - hover | focus | manual
delaynumber | object0 -

delay showing and hiding the tooltip (ms) - does not apply to manual trigger type

-

If a number is supplied, delay is applied to both hide/show

-

Object structure is: delay: { show: 500, hide: 100 }

-
-
- Heads up! - Options for individual tooltips can alternatively be specified through the use of data attributes. -
+
+ + +

Usage

+

Trigger the tooltip via javascript:

+
$('#example').tooltip(options)
+ +

Options

+

Options can be passed via data attributes or javascript. For data attributes, append the option name to data-, as in data-animation="".

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nametypedefaultdescription
animationbooleantrueapply a css fade transition to the tooltip
htmlbooleantrueInsert html into the tooltip. If false, jquery's text method will be used to insert content into the dom. Use text if you're worried about XSS attacks.
placementstring|function'top'how to position the tooltip - top | bottom | left | right
selectorstringfalseIf a selector is provided, tooltip objects will be delegated to the specified targets.
titlestring | function''default title value if `title` tag isn't present
triggerstring'hover'how tooltip is triggered - hover | focus | manual
delaynumber | object0 +

delay showing and hiding the tooltip (ms) - does not apply to manual trigger type

+

If a number is supplied, delay is applied to both hide/show

+

Object structure is: delay: { show: 500, hide: 100 }

+
+
+ Heads up! + Options for individual tooltips can alternatively be specified through the use of data attributes. +
-

Markup

-

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

-
-    <a href="#" rel="tooltip" title="first tooltip">hover over me</a>
-    
- -

Methods

-

$().tooltip(options)

-

Attaches a tooltip handler to an element collection.

-

.tooltip('show')

-

Reveals an element's tooltip.

-
$('#element').tooltip('show')
-

.tooltip('hide')

-

Hides an element's tooltip.

-
$('#element').tooltip('hide')
-

.tooltip('toggle')

-

Toggles an element's tooltip.

-
$('#element').tooltip('toggle')
-

.tooltip('destroy')

-

Destroys an element's tooltip.

-
$('#element').tooltip('destroy')
-
- - - - -
- +

Markup

+

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

+
+<a href="#" rel="tooltip" title="first tooltip">hover over me</a>
+
-

Examples

-

Add small overlays of content, like those on the iPad, to any element for housing secondary information. Hover over the button to trigger the popover. Requires Tooltip to be included.

- -

Static popover

-

Four options are available: top, right, bottom, and left aligned.

-
-
-
-

Popover top

-
-

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

-
+

Methods

+

$().tooltip(options)

+

Attaches a tooltip handler to an element collection.

+

.tooltip('show')

+

Reveals an element's tooltip.

+
$('#element').tooltip('show')
+

.tooltip('hide')

+

Hides an element's tooltip.

+
$('#element').tooltip('hide')
+

.tooltip('toggle')

+

Toggles an element's tooltip.

+
$('#element').tooltip('toggle')
+

.tooltip('destroy')

+

Destroys an element's tooltip.

+
$('#element').tooltip('destroy')
+
+ + + + +
+ -
-
-

Popover right

-
-

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

+

Examples

+

Add small overlays of content, like those on the iPad, to any element for housing secondary information. Hover over the button to trigger the popover. Requires Tooltip to be included.

+ +

Static popover

+

Four options are available: top, right, bottom, and left aligned.

+
+
+
+

Popover top

+
+

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

+
-
-
-
-

Popover bottom

-
-

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

+
+
+

Popover right

+
+

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

+
-
-
-
-

Popover left

-
-

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

+
+
+

Popover bottom

+
+

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

+
-
-
-
-

No markup shown as popovers are generated from javascript and content within a data attribute.

+
+
+

Popover left

+
+

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

+
+
-

Live demo

- +
+
+

No markup shown as popovers are generated from javascript and content within a data attribute.

+

Live demo

+ -
- - -

Usage

-

Enable popovers via javascript:

-
$('#example').popover(options)
- -

Options

-

Options can be passed via data attributes or javascript. For data attributes, append the option name to data-, as in data-animation="".

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Nametypedefaultdescription
animationbooleantrueapply a css fade transition to the tooltip
htmlbooleantrueInsert html into the popover. If false, jquery's text method will be used to insert content into the dom. Use text if you're worried about XSS attacks.
placementstring|function'right'how to position the popover - top | bottom | left | right
selectorstringfalseif a selector is provided, tooltip objects will be delegated to the specified targets
triggerstring'hover'how popover is triggered - hover | focus | manual
titlestring | function''default title value if `title` attribute isn't present
contentstring | function''default content value if `data-content` attribute isn't present
delaynumber | object0 -

delay showing and hiding the popover (ms) - does not apply to manual trigger type

-

If a number is supplied, delay is applied to both hide/show

-

Object structure is: delay: { show: 500, hide: 100 }

-
-
- Heads up! - Options for individual popovers can alternatively be specified through the use of data attributes. -
-

Markup

-

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)

-

Initializes popovers for an element collection.

-

.popover('show')

-

Reveals an elements popover.

-
$('#element').popover('show')
-

.popover('hide')

-

Hides an elements popover.

-
$('#element').popover('hide')
-

.popover('toggle')

-

Toggles an elements popover.

-
$('#element').popover('toggle')
-

.popover('destroy')

-

Destroys an element's popover.

-
$('#element').popover('destroy')
-
- - - - -
- +
+ + +

Usage

+

Enable popovers via javascript:

+
$('#example').popover(options)
+ +

Options

+

Options can be passed via data attributes or javascript. For data attributes, append the option name to data-, as in data-animation="".

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nametypedefaultdescription
animationbooleantrueapply a css fade transition to the tooltip
htmlbooleantrueInsert html into the popover. If false, jquery's text method will be used to insert content into the dom. Use text if you're worried about XSS attacks.
placementstring|function'right'how to position the popover - top | bottom | left | right
selectorstringfalseif a selector is provided, tooltip objects will be delegated to the specified targets
triggerstring'hover'how popover is triggered - hover | focus | manual
titlestring | function''default title value if `title` attribute isn't present
contentstring | function''default content value if `data-content` attribute isn't present
delaynumber | object0 +

delay showing and hiding the popover (ms) - does not apply to manual trigger type

+

If a number is supplied, delay is applied to both hide/show

+

Object structure is: delay: { show: 500, hide: 100 }

+
+
+ Heads up! + Options for individual popovers can alternatively be specified through the use of data attributes. +
+ +

Markup

+

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)

+

Initializes popovers for an element collection.

+

.popover('show')

+

Reveals an elements popover.

+
$('#element').popover('show')
+

.popover('hide')

+

Hides an elements popover.

+
$('#element').popover('hide')
+

.popover('toggle')

+

Toggles an elements popover.

+
$('#element').popover('toggle')
+

.popover('destroy')

+

Destroys an element's popover.

+
$('#element').popover('destroy')
+
+ + + + +
+ -

Example alerts

-

Add dismiss functionality to all alerge messages with this plugin.

-
-
- - Holy guacamole! Best check yo self, you're not looking too good. +

Example alerts

+

Add dismiss functionality to all alerge messages with this plugin.

+
+
+ + Holy guacamole! Best check yo self, you're not looking too good. +
-
-
-
- -

Oh snap! You got an error!

-

Change this and that and try again. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.

-

- Take this action Or do this -

+
+
+ +

Oh snap! You got an error!

+

Change this and that and try again. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.

+

+ Take this action Or do this +

+
-
-
- - -

Usage

-

Enable dismissal of an alert via javascript:

-
$(".alert").alert()
- -

Markup

-

Just add data-dismiss="alert" to your close button to automatically give an alert close functionality.

-
<a class="close" data-dismiss="alert" href="#">&times;</a>
- -

Methods

-

$().alert()

-

Wraps all alerts with close functionality. To have your alerts animate out when closed, make sure they have the .fade and .in class already applied to them.

-

.alert('close')

-

Closes an alert.

-
$(".alert").alert('close')
- - -

Events

-

Bootstrap's alert class exposes a few events for hooking into alert functionality.

- - - - - - - - - - - - - - - - - -
EventDescription
closeThis event fires immediately when the close instance method is called.
closedThis event is fired when the alert has been closed (will wait for css transitions to complete).
+
+ + +

Usage

+

Enable dismissal of an alert via javascript:

+
$(".alert").alert()
+ +

Markup

+

Just add data-dismiss="alert" to your close button to automatically give an alert close functionality.

+
<a class="close" data-dismiss="alert" href="#">&times;</a>
+ +

Methods

+

$().alert()

+

Wraps all alerts with close functionality. To have your alerts animate out when closed, make sure they have the .fade and .in class already applied to them.

+

.alert('close')

+

Closes an alert.

+
$(".alert").alert('close')
+ + +

Events

+

Bootstrap's alert class exposes a few events for hooking into alert functionality.

+ + + + + + + + + + + + + + + + + +
EventDescription
closeThis event fires immediately when the close instance method is called.
closedThis event is fired when the alert has been closed (will wait for css transitions to complete).
 $('#my-alert').bind('closed', function () {
   // do something…
-})
-
+}) + +
- -
- + +
+ -

Example uses

-

Do more with buttons. Control button states or create groups of buttons for more components like toolbars.

+

Example uses

+

Do more with buttons. Control button states or create groups of buttons for more components like toolbars.

-

Stateful

-

Add data-loading-text="Loading..." to use a loading state on a button.

-
- -
+

Stateful

+

Add data-loading-text="Loading..." to use a loading state on a button.

+
+ +
 <button type="button" class="btn btn-primary" data-loading-text="Loading...">Loading state</button>
 
-

Single toggle

-

Add data-toggle="button" to activate toggling on a single button.

-
- -
+

Single toggle

+

Add data-toggle="button" to activate toggling on a single button.

+
+ +
 <button type="button" class="btn" data-toggle="button">Single Toggle</button>
 
-

Checkbox

-

Add data-toggle="buttons-checkbox" for checkbox style toggling on btn-group.

-
-
- - - +

Checkbox

+

Add data-toggle="buttons-checkbox" for checkbox style toggling on btn-group.

+
+
+ + + +
-
 <div class="btn-group" data-toggle="buttons-checkbox">
   <button type="button" class="btn">Left</button>
@@ -1126,15 +1131,15 @@ $('#my-alert').bind('closed', function () {
 </div>
 
-

Radio

-

Add data-toggle="buttons-radio" for radio style toggling on btn-group.

-
-
- - - +

Radio

+

Add data-toggle="buttons-radio" for radio style toggling on btn-group.

+
+
+ + + +
-
 <div class="btn-group" data-toggle="buttons-radio">
   <button type="button" class="btn">Left</button>
@@ -1144,101 +1149,101 @@ $('#my-alert').bind('closed', function () {
 
-
+
-

Usage

-

Enable buttons via javascript:

-
$('.nav-tabs').button()
+

Usage

+

Enable buttons via javascript:

+
$('.nav-tabs').button()
-

Markup

-

Data attributes are integral to the button plugin. Check out the example code below for the various markup types.

+

Markup

+

Data attributes are integral to the button plugin. Check out the example code below for the various markup types.

-

Options

-

None

+

Options

+

None

-

Methods

-

$().button('toggle')

-

Toggles push state. Gives the button the appearance that it has been activated.

-
- Heads up! - You can enable auto toggling of a button by using the data-toggle attribute. -
-
<button type="button" class="btn" data-toggle="button" >…</button>
-

$().button('loading')

-

Sets button state to loading - disables button and swaps text to loading text. Loading text should be defined on the button element using the data attribute data-loading-text. -

-
<button type="button" class="btn" data-loading-text="loading stuff..." >...</button>
-
- Heads up! - Firefox persists the disabled state across page loads. A workaround for this is to use autocomplete="off". -
-

$().button('reset')

-

Resets button state - swaps text to original text.

-

$().button(string)

-

Resets button state - swaps text to any data defined text state.

+

Methods

+

$().button('toggle')

+

Toggles push state. Gives the button the appearance that it has been activated.

+
+ Heads up! + You can enable auto toggling of a button by using the data-toggle attribute. +
+
<button type="button" class="btn" data-toggle="button" >…</button>
+

$().button('loading')

+

Sets button state to loading - disables button and swaps text to loading text. Loading text should be defined on the button element using the data attribute data-loading-text. +

+
<button type="button" class="btn" data-loading-text="loading stuff..." >...</button>
+
+ Heads up! + Firefox persists the disabled state across page loads. A workaround for this is to use autocomplete="off". +
+

$().button('reset')

+

Resets button state - swaps text to original text.

+

$().button(string)

+

Resets button state - swaps text to any data defined text state.

<button type="button" class="btn" data-complete-text="finished!" >...</button>
 <script>
   $('.btn').button('complete')
 </script>
-
+
- -
- + +
+ -

About

-

Get base styles and flexible support for collapsible components like accordions and navigation.

-

* Requires the Transitions plugin to be included.

+

About

+

Get base styles and flexible support for collapsible components like accordions and navigation.

+

* Requires the Transitions plugin to be included.

-

Example accordion

-

Using the collapse plugin, we built a simple accordion style widget:

+

Example accordion

+

Using the collapse plugin, we built a simple accordion style widget:

-
-
-
- -
-
- Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. +
+ -
- -
-
- Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. +
+
+ Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. +
-
-
-
- - Collapsible Group Item #3 - +
+ +
+
+ Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. +
+
-
-
- Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. +
+ +
+
+ Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. +
-
 <button type="button" class="btn btn-danger" data-toggle="collapse" data-target="#demo">
   simple collapsible
@@ -1248,137 +1253,137 @@ $('#my-alert').bind('closed', function () {
 
-
- - -

Usage

- -

Via data attributes

-

Just add data-toggle="collapse" and a data-target to element to automatically assign control of a collapsible element. The data-target attribute accepts a css selector to apply the collapse to. Be sure to add the class collapse to the collapsible element. If you'd like it to default open, add the additional class in.

-

To add accordion-like group management to a collapsible control, add the data attribute data-parent="#selector". Refer to the demo to see this in action.

- -

Via javascript

-

Enable manually with:

-
$(".collapse").collapse()
- -

Options

-

Options can be passed via data attributes or javascript. For data attributes, append the option name to data-, as in data-parent="".

- - - - - - - - - - - - - - - - - - - - - - - -
Nametypedefaultdescription
parentselectorfalseIf selector then all collapsible elements under the specified parent will be closed when this collapsible item is shown. (similar to traditional accordion behavior)
togglebooleantrueToggles the collapsible element on invocation
- - -

Methods

-

.collapse(options)

-

Activates your content as a collapsible element. Accepts an optional options object. +


+ + +

Usage

+ +

Via data attributes

+

Just add data-toggle="collapse" and a data-target to element to automatically assign control of a collapsible element. The data-target attribute accepts a css selector to apply the collapse to. Be sure to add the class collapse to the collapsible element. If you'd like it to default open, add the additional class in.

+

To add accordion-like group management to a collapsible control, add the data attribute data-parent="#selector". Refer to the demo to see this in action.

+ +

Via javascript

+

Enable manually with:

+
$(".collapse").collapse()
+ +

Options

+

Options can be passed via data attributes or javascript. For data attributes, append the option name to data-, as in data-parent="".

+ + + + + + + + + + + + + + + + + + + + + + + +
Nametypedefaultdescription
parentselectorfalseIf selector then all collapsible elements under the specified parent will be closed when this collapsible item is shown. (similar to traditional accordion behavior)
togglebooleantrueToggles the collapsible element on invocation
+ + +

Methods

+

.collapse(options)

+

Activates your content as a collapsible element. Accepts an optional options object.

 $('#myCollapsible').collapse({
   toggle: false
 })
-

.collapse('toggle')

-

Toggles a collapsible element to shown or hidden.

-

.collapse('show')

-

Shows a collapsible element.

-

.collapse('hide')

-

Hides a collapsible element.

- -

Events

-

Bootstrap's collapse class exposes a few events for hooking into collapse functionality.

- - - - - - - - - - - - - - - - - - - - - - - - - -
EventDescription
showThis event fires immediately when the show instance method is called.
shownThis event is fired when a collapse element has been made visible to the user (will wait for css transitions to complete).
hide - This event is fired immediately when the hide method has been called. -
hiddenThis event is fired when a collapse element has been hidden from the user (will wait for css transitions to complete).
+

.collapse('toggle')

+

Toggles a collapsible element to shown or hidden.

+

.collapse('show')

+

Shows a collapsible element.

+

.collapse('hide')

+

Hides a collapsible element.

+ +

Events

+

Bootstrap's collapse class exposes a few events for hooking into collapse functionality.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
EventDescription
showThis event fires immediately when the show instance method is called.
shownThis event is fired when a collapse element has been made visible to the user (will wait for css transitions to complete).
hide + This event is fired immediately when the hide method has been called. +
hiddenThis event is fired when a collapse element has been hidden from the user (will wait for css transitions to complete).
 $('#myCollapsible').on('hidden', function () {
   // do something…
 })
-
+
- - + - - + -- cgit v1.2.3 From 9343e1e933c1a38ec4cc58024b01edda631863b0 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Thu, 12 Jul 2012 21:38:18 -0700 Subject: remove getting started link from home, add to navbar, overhaul getting started docs --- docs/javascript.html | 3 +++ 1 file changed, 3 insertions(+) (limited to 'docs/javascript.html') diff --git a/docs/javascript.html b/docs/javascript.html index 21d0044b0..42c8a6f7e 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -45,6 +45,9 @@
  • Home
  • +
  • + Get started +
  • Scaffolding
  • -- cgit v1.2.3 From b9105b98f9ee5f15d5b18bccf277344683d4a6db Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Fri, 20 Jul 2012 22:06:47 -0700 Subject: move from downloads.html to customize.html to better match purpose of page, fix up customize page layout to match other docs, link style refinement to jumbotrons --- docs/javascript.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/javascript.html') diff --git a/docs/javascript.html b/docs/javascript.html index 42c8a6f7e..70355957c 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -61,7 +61,7 @@ Javascript
  • - Extend + Customize
  • -- cgit v1.2.3 From fae6c36874b102408b53c6e5d980b247a9779dea Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Sun, 22 Jul 2012 14:50:52 -0700 Subject: adds minLength #3960 --- docs/javascript.html | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'docs/javascript.html') diff --git a/docs/javascript.html b/docs/javascript.html index 70355957c..9b2897699 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -1543,6 +1543,12 @@ $('.carousel').carousel({ 8 The max number of items to display in the dropdown. + + minLength + number + 1 + The minimum character length needed before triggering autocomplete suggestions + matcher function -- cgit v1.2.3 From dcf75697ecd243517b23d8ef440f772d91f699c0 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Sun, 22 Jul 2012 18:28:39 -0700 Subject: some progress on affix plugin --- docs/javascript.html | 107 +++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 91 insertions(+), 16 deletions(-) (limited to 'docs/javascript.html') diff --git a/docs/javascript.html b/docs/javascript.html index 9b2897699..bc17456ea 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -85,7 +85,8 @@ ================================================== -->
    -

    Individual or compiled

    -

    If you have downloaded the latest version of Bootstrap, both bootstrap.js and bootstrap.min.js contain all of these plugins.

    +

    If you have downloaded the latest version of Bootstrap, both bootstrap.js and bootstrap.min.js contain all of the plugins listed on this page.

    Data attributes

    -

    ...

    +

    You can use all Bootstrap plugins purely through the markup API without writing a single line of JavaScript. This is Bootstrap's first class API and should be your first consideration when using a plugin.

    + +

    That said, in some situations it may be desirable to turn this functionality off. Therefore, we also provide the ability to disable the data attribute API by unbinding all events on the body namespaced with `'data-api'`. This looks like this: + +

    +  $('body').off('.data-api')
    +
    + +

    Alternatively, to target a specific plugin, just include the plugins name as a namespace along with the data-api namespace like this:

    + +
    +  $('body').off('.alert.data-api')
    +

    Programmatic API

    -

    ...

    +

    We also believe you should be able to use all Bootstrap plugins purely through the JavaScript API. All public APIs are single, chainable methods, and return the collection acted upon.

    + +
    +  $(".btn.danger").button("toggle").addClass("fat")
    +
    + +

    All methods should accept an optional options object, a string which targets a particular method, or nothing (which initiates a plugin with default behavior):

    +
    +  $("#myModal").modal()                       // initialized with defaults
    +  $("#myModal").modal({ keyboard: false })   // initialized with no keyboard
    +  $("#myModal").modal('show')                // initializes and invokes show immediately

    +
    +

    Each plugin also exposes it's raw constructor on a `Constructor` property: $.fn.popover.Constructor. If you'd like to get a particular plugin instance, retrieve it directly from an element: $('[rel=popover]').data('popover').

    + + +

    Events

    +

    Bootstrap provides custom events for most plugin's unique actions. Generally, these come in an infinitive and past participle form - where the infinitive (ex. show) is triggered at the start of an event, and it's past participle form (ex. shown) is trigger on the completion of an action.

    + +

    All infinitive events provide preventDefault functionality. This provides the abililty to stop the execution of an action before it starts.

    + +
    +  $('#myModal').on('show', function (e) {
    +      if (!data) return e.preventDefault() // stops modal from being shown
    +  })
    +
    @@ -849,7 +886,7 @@ $('a[data-toggle="tab"]').on('shown', function (e) {

    Toggles an element's tooltip.

    $('#element').tooltip('toggle')

    .tooltip('destroy')

    -

    Destroys an element's tooltip.

    +

    Hides and destroys an element's tooltip.

    $('#element').tooltip('destroy')
    @@ -1004,7 +1041,7 @@ $('a[data-toggle="tab"]').on('shown', function (e) {

    Toggles an elements popover.

    $('#element').popover('toggle')

    .popover('destroy')

    -

    Destroys an element's popover.

    +

    Hides and destroys an element's popover.

    $('#element').popover('destroy')
    @@ -1581,23 +1618,60 @@ $('.carousel').carousel({ ================================================== -->
    -

    ...

    -

    ...

    -
    +

    Example

    +

    The subnavigation on the left is a live demo of the affix plugin.

    + +
    + +

    Usage

    + +

    Via data attributes

    +

    To easily add affix behavior to any element, just add data-spy="affix" to the element you want to spy on. When the affix offsets are satisified, an .affix class is added to the element.

    + +
    <div data-spy="affix">...</body>
    + +
    + Heads up! + It's up to you to maintain the dimensions of an element when toggling between relative and fixed positions. To see how this is done, refer to this pages subnavigation.
    + +

    Via javascript

    +

    Call the affix plugin via javascript:

    +
    $('#navbar').affix()
    + +

    Methods

    +

    .scrollspy('refresh')

    +

    When using affix in conjunction with adding or removing of elements from the DOM, you'll need to call the refresh method like so:

    -...
    +$('[data-spy="affix"]').each(function () {
    +  $(this).affix('refresh')
    +});
     
    -
    - +

    Options

    +

    Options can be passed via data attributes or javascript. For data attributes, append the option name to data-, as in data-offset-y="".

    + + + + + + + + + + + + + + + + + +
    Nametypedefaultdescription
    offsetnumber | object10Pixels to offset from screen when calculating position of scroll. If a single number is provide, the offset will be applied in both top and left directions. To listen for a single direction, or multiple unique offsets, just provided an object offset: { x: 10 }.
    @@ -1642,6 +1716,7 @@ $('.carousel').carousel({ + -- cgit v1.2.3 From 0dda2c4659c6e0407b5b9fda6618ab5c8c12a897 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Mon, 23 Jul 2012 22:36:08 -0700 Subject: make docs scroll over jumbotrons, but only for 980px up --- docs/javascript.html | 2400 +++++++++++++++++++++++++------------------------- 1 file changed, 1198 insertions(+), 1202 deletions(-) (limited to 'docs/javascript.html') diff --git a/docs/javascript.html b/docs/javascript.html index 70355957c..2e51ba527 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -78,104 +78,105 @@ -
    - - - -
    - -
    +
    +
    + +
    + +
    - -
    - -

    Individual or compiled

    -

    If you have downloaded the latest version of Bootstrap, both bootstrap.js and bootstrap.min.js contain all of these plugins.

    -

    Data attributes

    -

    ...

    + +
    + -

    Programmatic API

    -

    ...

    +

    Individual or compiled

    +

    If you have downloaded the latest version of Bootstrap, both bootstrap.js and bootstrap.min.js contain all of these plugins.

    +

    Data attributes

    +

    ...

    +

    Programmatic API

    +

    ...

    -
    +
    - -
    - -

    About transitions

    -

    For simple transition effects, include bootstrap-transition.js once alongside the other JS files. If you're using the compiled (or minified) bootstrap.js, there is no need to include this—it's already there.

    -

    Use cases

    -

    A few examples of the transition plugin:

    -
      -
    • Sliding or fading in modals
    • -
    • Fading out tabs
    • -
    • Fading out alerts
    • -
    • Sliding carousel panes
    • -
    -
    + +
    + +

    About transitions

    +

    For simple transition effects, include bootstrap-transition.js once alongside the other JS files. If you're using the compiled (or minified) bootstrap.js, there is no need to include this—it's already there.

    +

    Use cases

    +

    A few examples of the transition plugin:

    +
      +
    • Sliding or fading in modals
    • +
    • Fading out tabs
    • +
    • Fading out alerts
    • +
    • Sliding carousel panes
    • +
    +
    - -
    - -

    Examples

    -

    Modals are streamlined, but flexible, dialog prompts with the minimum required functionality and smart defaults.

    + +
    + -

    Static example

    -

    A rendered modal with header, body, and set of actions in the footer.

    -
    -
    +
    - - - -
    - + +
    + -

    Example in navbar

    -

    The ScrollSpy plugin is for automatically updating nav targets based on scroll position. Scroll the area below the navbar and watch the active class change. The dropdown sub items will be highlighted as well.

    -
    -
    - - - - -
    - +

    Options

    +

    Options can be passed via data attributes or javascript. For data attributes, append the option name to data-, as in data-offset="".

    + + + + + + + + + + + + + + + + + +
    Nametypedefaultdescription
    offsetnumber10Pixels to offset from top when calculating position of scroll.
    + +

    Events

    + + + + + + + + + + + + + +
    EventDescription
    activateThis event fires whenever a new item becomes activated by the scrollspy.
    +
    + + + + +
    + -

    Example tabs

    -

    Add quick, dynamic tab functionality to transiton through panes of local content, even via dropdown menus.

    -
    - -
    -
    -

    Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.

    -
    -
    -

    Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.

    -
    - - -
    +
    -

    Usage

    -

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

    +

    Usage

    +

    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:

    +

    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
    @@ -666,8 +666,8 @@ $('#myTab a:last').tab('show'); // Select last tab
     $('#myTab li:eq(2) a').tab('show'); // Select third tab (0-indexed)
     
    -

    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. Adding the nav and nav-tabs classes to the tab ul will apply the bootstrap tab styling.

    +

    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. 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>
    @@ -676,11 +676,11 @@ $('#myTab li:eq(2) a').tab('show'); // Select third tab (0-indexed)
       <li><a href="#settings" data-toggle="tab">Settings</a></li>
     </ul>
    -

    Methods

    -

    $().tab

    -

    - Activates a tab element and content container. Tab should have either a data-target or an href targeting a container node in the DOM. -

    +

    Methods

    +

    $().tab

    +

    + 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" id="myTab">
       <li class="active"><a href="#home">Home</a></li>
    @@ -703,429 +703,425 @@ $('#myTab li:eq(2) a').tab('show'); // Select third tab (0-indexed)
     </script>
     
    -

    Events

    - - - - - - - - - - - - - - - - - -
    EventDescription
    showThis event fires on tab show, but before the new tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively.
    shownThis event fires on tab show after a tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively.
    +

    Events

    + + + + + + + + + + + + + + + + + +
    EventDescription
    showThis event fires on tab show, but before the new tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively.
    shownThis event fires on tab show after a tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively.
     $('a[data-toggle="tab"]').on('shown', function (e) {
       e.target // activated tab
       e.relatedTarget // previous tab
     })
     
    -
    +
    - -
    - + +
    + -

    Examples

    -

    Inspired by the excellent jQuery.tipsy plugin written by Jason Frame; Tooltips are an updated version, which don't rely on images, use CSS3 for animations, and data-attributes for local title storage.

    -

    Hover over the links below to see tooltips:

    -
    -

    Tight pants next level keffiyeh you probably haven't heard of them. Photo booth beard raw denim letterpress vegan messenger bag stumptown. Farm-to-table seitan, mcsweeney's fixie sustainable quinoa 8-bit american apparel have a terry richardson vinyl chambray. Beard stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, four loko mcsweeney's cleanse vegan chambray. A really ironic artisan whatever keytar, scenester farm-to-table banksy Austin twitter handle freegan cred raw denim single-origin coffee viral. -

    -
    +

    Examples

    +

    Inspired by the excellent jQuery.tipsy plugin written by Jason Frame; Tooltips are an updated version, which don't rely on images, use CSS3 for animations, and data-attributes for local title storage.

    +

    Hover over the links below to see tooltips:

    +
    +

    Tight pants next level keffiyeh you probably haven't heard of them. Photo booth beard raw denim letterpress vegan messenger bag stumptown. Farm-to-table seitan, mcsweeney's fixie sustainable quinoa 8-bit american apparel have a terry richardson vinyl chambray. Beard stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, four loko mcsweeney's cleanse vegan chambray. A really ironic artisan whatever keytar, scenester farm-to-table banksy Austin twitter handle freegan cred raw denim single-origin coffee viral. +

    +
    -

    Four directions

    - +

    Four directions

    + -
    - - -

    Usage

    -

    Trigger the tooltip via javascript:

    -
    $('#example').tooltip(options)
    - -

    Options

    -

    Options can be passed via data attributes or javascript. For data attributes, append the option name to data-, as in data-animation="".

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Nametypedefaultdescription
    animationbooleantrueapply a css fade transition to the tooltip
    htmlbooleantrueInsert html into the tooltip. If false, jquery's text method will be used to insert content into the dom. Use text if you're worried about XSS attacks.
    placementstring|function'top'how to position the tooltip - top | bottom | left | right
    selectorstringfalseIf a selector is provided, tooltip objects will be delegated to the specified targets.
    titlestring | function''default title value if `title` tag isn't present
    triggerstring'hover'how tooltip is triggered - hover | focus | manual
    delaynumber | object0 -

    delay showing and hiding the tooltip (ms) - does not apply to manual trigger type

    -

    If a number is supplied, delay is applied to both hide/show

    -

    Object structure is: delay: { show: 500, hide: 100 }

    -
    -
    - Heads up! - Options for individual tooltips can alternatively be specified through the use of data attributes. -
    +
    + + +

    Usage

    +

    Trigger the tooltip via javascript:

    +
    $('#example').tooltip(options)
    + +

    Options

    +

    Options can be passed via data attributes or javascript. For data attributes, append the option name to data-, as in data-animation="".

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Nametypedefaultdescription
    animationbooleantrueapply a css fade transition to the tooltip
    htmlbooleantrueInsert html into the tooltip. If false, jquery's text method will be used to insert content into the dom. Use text if you're worried about XSS attacks.
    placementstring|function'top'how to position the tooltip - top | bottom | left | right
    selectorstringfalseIf a selector is provided, tooltip objects will be delegated to the specified targets.
    titlestring | function''default title value if `title` tag isn't present
    triggerstring'hover'how tooltip is triggered - hover | focus | manual
    delaynumber | object0 +

    delay showing and hiding the tooltip (ms) - does not apply to manual trigger type

    +

    If a number is supplied, delay is applied to both hide/show

    +

    Object structure is: delay: { show: 500, hide: 100 }

    +
    +
    + Heads up! + Options for individual tooltips can alternatively be specified through the use of data attributes. +
    -

    Markup

    -

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

    +

    Markup

    +

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

     <a href="#" rel="tooltip" title="first tooltip">hover over me</a>
     
    -

    Methods

    -

    $().tooltip(options)

    -

    Attaches a tooltip handler to an element collection.

    -

    .tooltip('show')

    -

    Reveals an element's tooltip.

    -
    $('#element').tooltip('show')
    -

    .tooltip('hide')

    -

    Hides an element's tooltip.

    -
    $('#element').tooltip('hide')
    -

    .tooltip('toggle')

    -

    Toggles an element's tooltip.

    -
    $('#element').tooltip('toggle')
    -

    .tooltip('destroy')

    -

    Destroys an element's tooltip.

    -
    $('#element').tooltip('destroy')
    -
    - - - - -
    - +

    Methods

    +

    $().tooltip(options)

    +

    Attaches a tooltip handler to an element collection.

    +

    .tooltip('show')

    +

    Reveals an element's tooltip.

    +
    $('#element').tooltip('show')
    +

    .tooltip('hide')

    +

    Hides an element's tooltip.

    +
    $('#element').tooltip('hide')
    +

    .tooltip('toggle')

    +

    Toggles an element's tooltip.

    +
    $('#element').tooltip('toggle')
    +

    .tooltip('destroy')

    +

    Destroys an element's tooltip.

    +
    $('#element').tooltip('destroy')
    +
    + + + + +
    + -

    Examples

    -

    Add small overlays of content, like those on the iPad, to any element for housing secondary information. Hover over the button to trigger the popover. Requires Tooltip to be included.

    - -

    Static popover

    -

    Four options are available: top, right, bottom, and left aligned.

    -
    -
    -
    -

    Popover top

    -
    -

    Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

    +

    Examples

    +

    Add small overlays of content, like those on the iPad, to any element for housing secondary information. Hover over the button to trigger the popover. Requires Tooltip to be included.

    + +

    Static popover

    +

    Four options are available: top, right, bottom, and left aligned.

    +
    +
    +
    +

    Popover top

    +
    +

    Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

    +
    -
    -
    -
    -

    Popover right

    -
    -

    Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

    +
    +
    +

    Popover right

    +
    +

    Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

    +
    -
    -
    -
    -

    Popover bottom

    -
    -

    Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

    +
    +
    +

    Popover bottom

    +
    +

    Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

    +
    -
    -
    -
    -

    Popover left

    -
    -

    Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

    +
    +
    +

    Popover left

    +
    +

    Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

    +
    -
    -
    -
    -

    No markup shown as popovers are generated from javascript and content within a data attribute.

    +
    +
    +

    No markup shown as popovers are generated from javascript and content within a data attribute.

    -

    Live demo

    - +

    Live demo

    + -
    - - -

    Usage

    -

    Enable popovers via javascript:

    -
    $('#example').popover(options)
    - -

    Options

    -

    Options can be passed via data attributes or javascript. For data attributes, append the option name to data-, as in data-animation="".

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Nametypedefaultdescription
    animationbooleantrueapply a css fade transition to the tooltip
    htmlbooleantrueInsert html into the popover. If false, jquery's text method will be used to insert content into the dom. Use text if you're worried about XSS attacks.
    placementstring|function'right'how to position the popover - top | bottom | left | right
    selectorstringfalseif a selector is provided, tooltip objects will be delegated to the specified targets
    triggerstring'hover'how popover is triggered - hover | focus | manual
    titlestring | function''default title value if `title` attribute isn't present
    contentstring | function''default content value if `data-content` attribute isn't present
    delaynumber | object0 -

    delay showing and hiding the popover (ms) - does not apply to manual trigger type

    -

    If a number is supplied, delay is applied to both hide/show

    -

    Object structure is: delay: { show: 500, hide: 100 }

    -
    -
    - Heads up! - Options for individual popovers can alternatively be specified through the use of data attributes. -
    +
    + + +

    Usage

    +

    Enable popovers via javascript:

    +
    $('#example').popover(options)
    + +

    Options

    +

    Options can be passed via data attributes or javascript. For data attributes, append the option name to data-, as in data-animation="".

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Nametypedefaultdescription
    animationbooleantrueapply a css fade transition to the tooltip
    htmlbooleantrueInsert html into the popover. If false, jquery's text method will be used to insert content into the dom. Use text if you're worried about XSS attacks.
    placementstring|function'right'how to position the popover - top | bottom | left | right
    selectorstringfalseif a selector is provided, tooltip objects will be delegated to the specified targets
    triggerstring'hover'how popover is triggered - hover | focus | manual
    titlestring | function''default title value if `title` attribute isn't present
    contentstring | function''default content value if `data-content` attribute isn't present
    delaynumber | object0 +

    delay showing and hiding the popover (ms) - does not apply to manual trigger type

    +

    If a number is supplied, delay is applied to both hide/show

    +

    Object structure is: delay: { show: 500, hide: 100 }

    +
    +
    + Heads up! + Options for individual popovers can alternatively be specified through the use of data attributes. +
    -

    Markup

    -

    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)

    -

    Initializes popovers for an element collection.

    -

    .popover('show')

    -

    Reveals an elements popover.

    -
    $('#element').popover('show')
    -

    .popover('hide')

    -

    Hides an elements popover.

    -
    $('#element').popover('hide')
    -

    .popover('toggle')

    -

    Toggles an elements popover.

    -
    $('#element').popover('toggle')
    -

    .popover('destroy')

    -

    Destroys an element's popover.

    -
    $('#element').popover('destroy')
    -
    - - - - -
    - +

    Markup

    +

    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)

    +

    Initializes popovers for an element collection.

    +

    .popover('show')

    +

    Reveals an elements popover.

    +
    $('#element').popover('show')
    +

    .popover('hide')

    +

    Hides an elements popover.

    +
    $('#element').popover('hide')
    +

    .popover('toggle')

    +

    Toggles an elements popover.

    +
    $('#element').popover('toggle')
    +

    .popover('destroy')

    +

    Destroys an element's popover.

    +
    $('#element').popover('destroy')
    +
    + + + + +
    + -

    Example alerts

    -

    Add dismiss functionality to all alerge messages with this plugin.

    -
    -
    - - Holy guacamole! Best check yo self, you're not looking too good. +

    Example alerts

    +

    Add dismiss functionality to all alerge messages with this plugin.

    +
    +
    + + Holy guacamole! Best check yo self, you're not looking too good. +
    -
    -
    -
    - -

    Oh snap! You got an error!

    -

    Change this and that and try again. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.

    -

    - Take this action Or do this -

    +
    +
    + +

    Oh snap! You got an error!

    +

    Change this and that and try again. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.

    +

    + Take this action Or do this +

    +
    -
    -
    - - -

    Usage

    -

    Enable dismissal of an alert via javascript:

    -
    $(".alert").alert()
    - -

    Markup

    -

    Just add data-dismiss="alert" to your close button to automatically give an alert close functionality.

    -
    <a class="close" data-dismiss="alert" href="#">&times;</a>
    - -

    Methods

    -

    $().alert()

    -

    Wraps all alerts with close functionality. To have your alerts animate out when closed, make sure they have the .fade and .in class already applied to them.

    -

    .alert('close')

    -

    Closes an alert.

    -
    $(".alert").alert('close')
    - - -

    Events

    -

    Bootstrap's alert class exposes a few events for hooking into alert functionality.

    - - - - - - - - - - - - - - - - - -
    EventDescription
    closeThis event fires immediately when the close instance method is called.
    closedThis event is fired when the alert has been closed (will wait for css transitions to complete).
    +
    + + +

    Usage

    +

    Enable dismissal of an alert via javascript:

    +
    $(".alert").alert()
    + +

    Markup

    +

    Just add data-dismiss="alert" to your close button to automatically give an alert close functionality.

    +
    <a class="close" data-dismiss="alert" href="#">&times;</a>
    + +

    Methods

    +

    $().alert()

    +

    Wraps all alerts with close functionality. To have your alerts animate out when closed, make sure they have the .fade and .in class already applied to them.

    +

    .alert('close')

    +

    Closes an alert.

    +
    $(".alert").alert('close')
    + + +

    Events

    +

    Bootstrap's alert class exposes a few events for hooking into alert functionality.

    + + + + + + + + + + + + + + + + + +
    EventDescription
    closeThis event fires immediately when the close instance method is called.
    closedThis event is fired when the alert has been closed (will wait for css transitions to complete).
     $('#my-alert').bind('closed', function () {
       // do something…
     })
     
    -
    - +
    - -
    - -

    Example uses

    -

    Do more with buttons. Control button states or create groups of buttons for more components like toolbars.

    + +
    + -

    Stateful

    -

    Add data-loading-text="Loading..." to use a loading state on a button.

    -
    - -
    -
    -<button type="button" class="btn btn-primary" data-loading-text="Loading...">Loading state</button>
    -
    +

    Example uses

    +

    Do more with buttons. Control button states or create groups of buttons for more components like toolbars.

    -

    Single toggle

    -

    Add data-toggle="button" to activate toggling on a single button.

    -
    - -
    -
    -<button type="button" class="btn" data-toggle="button">Single Toggle</button>
    -
    +

    Stateful

    +

    Add data-loading-text="Loading..." to use a loading state on a button.

    +
    + +
    +
    <button type="button" class="btn btn-primary" data-loading-text="Loading...">Loading state</button>
    -

    Checkbox

    -

    Add data-toggle="buttons-checkbox" for checkbox style toggling on btn-group.

    -
    -
    - - - +

    Single toggle

    +

    Add data-toggle="button" to activate toggling on a single button.

    +
    + +
    +
    <button type="button" class="btn" data-toggle="button">Single Toggle</button>
    + +

    Checkbox

    +

    Add data-toggle="buttons-checkbox" for checkbox style toggling on btn-group.

    +
    +
    + + + +
    -
     <div class="btn-group" data-toggle="buttons-checkbox">
       <button type="button" class="btn">Left</button>
    @@ -1134,15 +1130,15 @@ $('#my-alert').bind('closed', function () {
     </div>
     
    -

    Radio

    -

    Add data-toggle="buttons-radio" for radio style toggling on btn-group.

    -
    -
    - - - +

    Radio

    +

    Add data-toggle="buttons-radio" for radio style toggling on btn-group.

    +
    +
    + + + +
    -
     <div class="btn-group" data-toggle="buttons-radio">
       <button type="button" class="btn">Left</button>
    @@ -1152,101 +1148,102 @@ $('#my-alert').bind('closed', function () {
     
    -
    +
    -

    Usage

    -

    Enable buttons via javascript:

    -
    $('.nav-tabs').button()
    +

    Usage

    +

    Enable buttons via javascript:

    +
    $('.nav-tabs').button()
    -

    Markup

    -

    Data attributes are integral to the button plugin. Check out the example code below for the various markup types.

    +

    Markup

    +

    Data attributes are integral to the button plugin. Check out the example code below for the various markup types.

    -

    Options

    -

    None

    +

    Options

    +

    None

    -

    Methods

    -

    $().button('toggle')

    -

    Toggles push state. Gives the button the appearance that it has been activated.

    -
    - Heads up! - You can enable auto toggling of a button by using the data-toggle attribute. -
    -
    <button type="button" class="btn" data-toggle="button" >…</button>
    -

    $().button('loading')

    -

    Sets button state to loading - disables button and swaps text to loading text. Loading text should be defined on the button element using the data attribute data-loading-text. -

    -
    <button type="button" class="btn" data-loading-text="loading stuff..." >...</button>
    -
    - Heads up! - Firefox persists the disabled state across page loads. A workaround for this is to use autocomplete="off". -
    -

    $().button('reset')

    -

    Resets button state - swaps text to original text.

    -

    $().button(string)

    -

    Resets button state - swaps text to any data defined text state.

    +

    Methods

    +

    $().button('toggle')

    +

    Toggles push state. Gives the button the appearance that it has been activated.

    +
    + Heads up! + You can enable auto toggling of a button by using the data-toggle attribute. +
    +
    <button type="button" class="btn" data-toggle="button" >…</button>
    +

    $().button('loading')

    +

    Sets button state to loading - disables button and swaps text to loading text. Loading text should be defined on the button element using the data attribute data-loading-text. +

    +
    <button type="button" class="btn" data-loading-text="loading stuff..." >...</button>
    +
    + Heads up! + Firefox persists the disabled state across page loads. A workaround for this is to use autocomplete="off". +
    +

    $().button('reset')

    +

    Resets button state - swaps text to original text.

    +

    $().button(string)

    +

    Resets button state - swaps text to any data defined text state.

    <button type="button" class="btn" data-complete-text="finished!" >...</button>
     <script>
       $('.btn').button('complete')
    -</script>
    -
    +</script> + +
    - -
    - + +
    + -

    About

    -

    Get base styles and flexible support for collapsible components like accordions and navigation.

    -

    * Requires the Transitions plugin to be included.

    +

    About

    +

    Get base styles and flexible support for collapsible components like accordions and navigation.

    +

    * Requires the Transitions plugin to be included.

    -

    Example accordion

    -

    Using the collapse plugin, we built a simple accordion style widget:

    +

    Example accordion

    +

    Using the collapse plugin, we built a simple accordion style widget:

    -
    -
    -
    - -
    -
    - Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. +
    + -
    - -
    -
    - Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. +
    +
    + Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. +
    -
    -
    -
    - - Collapsible Group Item #3 - +
    + +
    +
    + Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. +
    +
    -
    -
    - Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. +
    + +
    +
    + Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. +
    -
     <button type="button" class="btn btn-danger" data-toggle="collapse" data-target="#demo">
       simple collapsible
    @@ -1256,137 +1253,138 @@ $('#my-alert').bind('closed', function () {
     
    -
    - - -

    Usage

    - -

    Via data attributes

    -

    Just add data-toggle="collapse" and a data-target to element to automatically assign control of a collapsible element. The data-target attribute accepts a css selector to apply the collapse to. Be sure to add the class collapse to the collapsible element. If you'd like it to default open, add the additional class in.

    -

    To add accordion-like group management to a collapsible control, add the data attribute data-parent="#selector". Refer to the demo to see this in action.

    - -

    Via javascript

    -

    Enable manually with:

    -
    $(".collapse").collapse()
    - -

    Options

    -

    Options can be passed via data attributes or javascript. For data attributes, append the option name to data-, as in data-parent="".

    - - - - - - - - - - - - - - - - - - - - - - - -
    Nametypedefaultdescription
    parentselectorfalseIf selector then all collapsible elements under the specified parent will be closed when this collapsible item is shown. (similar to traditional accordion behavior)
    togglebooleantrueToggles the collapsible element on invocation
    - - -

    Methods

    -

    .collapse(options)

    -

    Activates your content as a collapsible element. Accepts an optional options object. +


    + + +

    Usage

    + +

    Via data attributes

    +

    Just add data-toggle="collapse" and a data-target to element to automatically assign control of a collapsible element. The data-target attribute accepts a css selector to apply the collapse to. Be sure to add the class collapse to the collapsible element. If you'd like it to default open, add the additional class in.

    +

    To add accordion-like group management to a collapsible control, add the data attribute data-parent="#selector". Refer to the demo to see this in action.

    + +

    Via javascript

    +

    Enable manually with:

    +
    $(".collapse").collapse()
    + +

    Options

    +

    Options can be passed via data attributes or javascript. For data attributes, append the option name to data-, as in data-parent="".

    + + + + + + + + + + + + + + + + + + + + + + + +
    Nametypedefaultdescription
    parentselectorfalseIf selector then all collapsible elements under the specified parent will be closed when this collapsible item is shown. (similar to traditional accordion behavior)
    togglebooleantrueToggles the collapsible element on invocation
    + + +

    Methods

    +

    .collapse(options)

    +

    Activates your content as a collapsible element. Accepts an optional options object.

     $('#myCollapsible').collapse({
       toggle: false
    -})
    -

    .collapse('toggle')

    -

    Toggles a collapsible element to shown or hidden.

    -

    .collapse('show')

    -

    Shows a collapsible element.

    -

    .collapse('hide')

    -

    Hides a collapsible element.

    - -

    Events

    -

    Bootstrap's collapse class exposes a few events for hooking into collapse functionality.

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    EventDescription
    showThis event fires immediately when the show instance method is called.
    shownThis event is fired when a collapse element has been made visible to the user (will wait for css transitions to complete).
    hide - This event is fired immediately when the hide method has been called. -
    hiddenThis event is fired when a collapse element has been hidden from the user (will wait for css transitions to complete).
    +}) + +

    .collapse('toggle')

    +

    Toggles a collapsible element to shown or hidden.

    +

    .collapse('show')

    +

    Shows a collapsible element.

    +

    .collapse('hide')

    +

    Hides a collapsible element.

    + +

    Events

    +

    Bootstrap's collapse class exposes a few events for hooking into collapse functionality.

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    EventDescription
    showThis event fires immediately when the show instance method is called.
    shownThis event is fired when a collapse element has been made visible to the user (will wait for css transitions to complete).
    hide + This event is fired immediately when the hide method has been called. +
    hiddenThis event is fired when a collapse element has been hidden from the user (will wait for css transitions to complete).
     $('#myCollapsible').on('hidden', function () {
       // do something…
     })
    -
    +
    - -
    +
    ...
    + +
    +
    -- cgit v1.2.3 From 4ea7c472358e2d77f76193ed3c1bafd641dd74ae Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Tue, 24 Jul 2012 00:21:40 -0700 Subject: slightly fix side bar --- docs/javascript.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/javascript.html') diff --git a/docs/javascript.html b/docs/javascript.html index bc17456ea..e0d549518 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -85,7 +85,7 @@ ================================================== -->
    -
    -
    -- cgit v1.2.3 From b7b4fd5c82ea321da3d7858e223eb6adcd225672 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Tue, 24 Jul 2012 01:53:32 -0700 Subject: wrap footer in bs docs canvas for scrolling doodad --- docs/javascript.html | 74 +++++++++++++++++++++++++++------------------------- 1 file changed, 38 insertions(+), 36 deletions(-) (limited to 'docs/javascript.html') diff --git a/docs/javascript.html b/docs/javascript.html index 001f974fc..5dc54fc49 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -1795,48 +1795,50 @@ $('[data-spy="affix"]').each(function () {
    -
    - - + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + +
    + -- cgit v1.2.3 From 4bb2a13776ac5addd3aa286cdad6506313983712 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Thu, 26 Jul 2012 21:45:30 -0700 Subject: rerun make --- docs/javascript.html | 804 +++++++++++++++++++++++++-------------------------- 1 file changed, 402 insertions(+), 402 deletions(-) (limited to 'docs/javascript.html') diff --git a/docs/javascript.html b/docs/javascript.html index 5dc54fc49..2e68dbb2b 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -169,34 +169,34 @@ $('#myModal').on('show', function (e) { - -
    - + +
    + -

    Examples

    -

    Modals are streamlined, but flexible, dialog prompts with the minimum required functionality and smart defaults.

    +

    Examples

    +

    Modals are streamlined, but flexible, dialog prompts with the minimum required functionality and smart defaults.

    -

    Static example

    -

    A rendered modal with header, body, and set of actions in the footer.

    -
    -
    - +
    - - - -
    - + +
    + -

    Example in navbar

    -

    The ScrollSpy plugin is for automatically updating nav targets based on scroll position. Scroll the area below the navbar and watch the active class change. The dropdown sub items will be highlighted as well.

    -
    -
    +

    Events

    + + + + + + + + + + + + + +
    EventDescription
    activateThis event fires whenever a new item becomes activated by the scrollspy.
    +
    - -
    - + +
    + -

    Example tabs

    -

    Add quick, dynamic tab functionality to transiton through panes of local content, even via dropdown menus.

    -
    - -
    -
    -

    Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.

    -
    -
    -

    Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.

    -
    - - +

    Example tabs

    +

    Add quick, dynamic tab functionality to transiton through panes of local content, even via dropdown menus.

    +
    + +
    +
    +

    Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.

    +
    +
    +

    Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.

    +
    + +
    +
    -
    +
    -

    Usage

    -

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

    +

    Usage

    +

    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:

    +

    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
    @@ -686,8 +686,8 @@ $('#myTab a:last').tab('show'); // Select last tab
     $('#myTab li:eq(2) a').tab('show'); // Select third tab (0-indexed)
     
    -

    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. Adding the nav and nav-tabs classes to the tab ul will apply the bootstrap tab styling.

    +

    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. 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>
    @@ -696,11 +696,11 @@ $('#myTab li:eq(2) a').tab('show'); // Select third tab (0-indexed)
       <li><a href="#settings" data-toggle="tab">Settings</a></li>
     </ul>
    -

    Methods

    -

    $().tab

    -

    - Activates a tab element and content container. Tab should have either a data-target or an href targeting a container node in the DOM. -

    +

    Methods

    +

    $().tab

    +

    + 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" id="myTab">
       <li class="active"><a href="#home">Home</a></li>
    @@ -723,25 +723,25 @@ $('#myTab li:eq(2) a').tab('show'); // Select third tab (0-indexed)
     </script>
     
    -

    Events

    - - - - - - - - - - - - - - - - - -
    EventDescription
    showThis event fires on tab show, but before the new tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively.
    shownThis event fires on tab show after a tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively.
    +

    Events

    + + + + + + + + + + + + + + + + + +
    EventDescription
    showThis event fires on tab show, but before the new tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively.
    shownThis event fires on tab show after a tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively.
     $('a[data-toggle="tab"]').on('shown', function (e) {
       e.target // activated tab
    -- 
    cgit v1.2.3
    
    
    From 79067721b110a60e24637cf3996cb0ffe9350475 Mon Sep 17 00:00:00 2001
    From: Mark Otto 
    Date: Thu, 26 Jul 2012 23:21:06 -0700
    Subject: fix js docs formatting
    
    ---
     docs/javascript.html | 509 +++++++++++++++++++--------------------------------
     1 file changed, 186 insertions(+), 323 deletions(-)
    
    (limited to 'docs/javascript.html')
    
    diff --git a/docs/javascript.html b/docs/javascript.html
    index 2e68dbb2b..36299d776 100644
    --- a/docs/javascript.html
    +++ b/docs/javascript.html
    @@ -894,351 +894,214 @@ $('a[data-toggle="tab"]').on('shown', function (e) {
                 
    -

    Examples

    -

    Add small overlays of content, like those on the iPad, to any element for housing secondary information. Hover over the button to trigger the popover. Requires Tooltip to be included.

    - -

    Static popover

    -

    Four options are available: top, right, bottom, and left aligned.

    -
    -
    -
    -

    Popover top

    -
    -

    Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

    -
    -
    - -
    -
    -

    Popover right

    -
    -

    Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

    -
    -
    - -
    -
    -

    Popover bottom

    -
    -

    Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

    -
    +
    +
    +

    Popover right

    +
    +

    Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

    +
    -
    -
    -

    Popover left

    -
    -

    Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

    -
    +
    +
    +

    Popover bottom

    +
    +

    Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

    - -
    -

    No markup shown as popovers are generated from javascript and content within a data attribute.

    -

    Live demo

    -
    - Hover for popover +
    +
    +

    Popover left

    +
    +

    Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

    +
    +
    +
    +

    No markup shown as popovers are generated from javascript and content within a data attribute.

    -
    - - -

    Usage

    -

    Enable popovers via javascript:

    -
    $('#example').popover(options)
    - -

    Options

    -

    Options can be passed via data attributes or javascript. For data attributes, append the option name to data-, as in data-animation="".

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Nametypedefaultdescription
    animationbooleantrueapply a css fade transition to the tooltip
    htmlbooleantrueInsert html into the popover. If false, jquery's text method will be used to insert content into the dom. Use text if you're worried about XSS attacks.
    placementstring|function'right'how to position the popover - top | bottom | left | right
    selectorstringfalseif a selector is provided, tooltip objects will be delegated to the specified targets
    triggerstring'hover'how popover is triggered - hover | focus | manual
    titlestring | function''default title value if `title` attribute isn't present
    contentstring | function''default content value if `data-content` attribute isn't present
    delaynumber | object0 -

    delay showing and hiding the popover (ms) - does not apply to manual trigger type

    -

    If a number is supplied, delay is applied to both hide/show

    -

    Object structure is: delay: { show: 500, hide: 100 }

    -
    -
    - Heads up! - Options for individual popovers can alternatively be specified through the use of data attributes. -
    +

    Live demo

    + -

    Markup

    -

    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)

    -

    Initializes popovers for an element collection.

    -

    .popover('show')

    -

    Reveals an elements popover.

    -
    $('#element').popover('show')
    -

    .popover('hide')

    -

    Hides an elements popover.

    -
    $('#element').popover('hide')
    -

    .popover('toggle')

    -

    Toggles an elements popover.

    -
    $('#element').popover('toggle')
    -

    .popover('destroy')

    -

    Hides and destroys an element's popover.

    -
    $('#element').popover('destroy')
    -
    +
    + + +

    Usage

    +

    Enable popovers via javascript:

    +
    $('#example').popover(options)
    + +

    Options

    +

    Options can be passed via data attributes or javascript. For data attributes, append the option name to data-, as in data-animation="".

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Nametypedefaultdescription
    animationbooleantrueapply a css fade transition to the tooltip
    htmlbooleantrueInsert html into the popover. If false, jquery's text method will be used to insert content into the dom. Use text if you're worried about XSS attacks.
    placementstring|function'right'how to position the popover - top | bottom | left | right
    selectorstringfalseif a selector is provided, tooltip objects will be delegated to the specified targets
    triggerstring'hover'how popover is triggered - hover | focus | manual
    titlestring | function''default title value if `title` attribute isn't present
    contentstring | function''default content value if `data-content` attribute isn't present
    delaynumber | object0 +

    delay showing and hiding the popover (ms) - does not apply to manual trigger type

    +

    If a number is supplied, delay is applied to both hide/show

    +

    Object structure is: delay: { show: 500, hide: 100 }

    +
    +
    + Heads up! + Options for individual popovers can alternatively be specified through the use of data attributes. +
    +

    Markup

    +

    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)

    +

    Initializes popovers for an element collection.

    +

    .popover('show')

    +

    Reveals an elements popover.

    +
    $('#element').popover('show')
    +

    .popover('hide')

    +

    Hides an elements popover.

    +
    $('#element').popover('hide')
    +

    .popover('toggle')

    +

    Toggles an elements popover.

    +
    $('#element').popover('toggle')
    +

    .popover('destroy')

    +

    Hides and destroys an element's popover.

    +
    $('#element').popover('destroy')
    +
    + + + + +
    + - -
    -
    - - - - -
    - - - -

    Example alerts

    -

    Add dismiss functionality to all alerge messages with this plugin.

    -
    -
    - - Holy guacamole! Best check yo self, you're not looking too good. -
    -
    - -
    -
    - -

    Oh snap! You got an error!

    -

    Change this and that and try again. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.

    -

    - Take this action Or do this -

    -
    -
    - - -
    - - -

    Usage

    -

    Enable dismissal of an alert via javascript:

    -
    $(".alert").alert()
    - -

    Markup

    -

    Just add data-dismiss="alert" to your close button to automatically give an alert close functionality.

    -
    <a class="close" data-dismiss="alert" href="#">&times;</a>
    - -

    Methods

    -

    $().alert()

    -

    Wraps all alerts with close functionality. To have your alerts animate out when closed, make sure they have the .fade and .in class already applied to them.

    -

    .alert('close')

    -

    Closes an alert.

    -
    $(".alert").alert('close')
    +
    +
    + +

    Oh snap! You got an error!

    +

    Change this and that and try again. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.

    +

    + Take this action Or do this +

    +
    +
    -

    Events

    -

    Bootstrap's alert class exposes a few events for hooking into alert functionality.

    - - - - - - - - - - - - - - - - - -
    EventDescription
    closeThis event fires immediately when the close instance method is called.
    closedThis event is fired when the alert has been closed (will wait for css transitions to complete).
    +
    + + +

    Usage

    +

    Enable dismissal of an alert via javascript:

    +
    $(".alert").alert()
    + +

    Markup

    +

    Just add data-dismiss="alert" to your close button to automatically give an alert close functionality.

    +
    <a class="close" data-dismiss="alert" href="#">&times;</a>
    + +

    Methods

    +

    $().alert()

    +

    Wraps all alerts with close functionality. To have your alerts animate out when closed, make sure they have the .fade and .in class already applied to them.

    +

    .alert('close')

    +

    Closes an alert.

    +
    $(".alert").alert('close')
    + + +

    Events

    +

    Bootstrap's alert class exposes a few events for hooking into alert functionality.

    + + + + + + + + + + + + + + + + + +
    EventDescription
    closeThis event fires immediately when the close instance method is called.
    closedThis event is fired when the alert has been closed (will wait for css transitions to complete).
     $('#my-alert').bind('closed', function () {
       // do something…
     })
     
    -
    +
    -- cgit v1.2.3 From a30045daef809edf5ed592ad842c04377898e444 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sun, 29 Jul 2012 00:30:15 -0700 Subject: reverse navbar styles to save code --- docs/javascript.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/javascript.html') diff --git a/docs/javascript.html b/docs/javascript.html index 36299d776..846089da8 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -31,7 +31,7 @@ -