From f764aee4b919c28974dba7b91edac9a04172ba25 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Mon, 23 Jan 2012 14:14:16 -0800 Subject: add templates for doc generation --- docs/templates/pages/javascript.mustache | 1299 ++++++++++++++++++++++++++++++ 1 file changed, 1299 insertions(+) create mode 100644 docs/templates/pages/javascript.mustache (limited to 'docs/templates/pages/javascript.mustache') diff --git a/docs/templates/pages/javascript.mustache b/docs/templates/pages/javascript.mustache new file mode 100644 index 000000000..aefe87846 --- /dev/null +++ b/docs/templates/pages/javascript.mustache @@ -0,0 +1,1299 @@ + +
+

Javascript for Bootstrap

+

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

+ + + +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ Select/Unselect All Plugins +

Note: All plugins require the latest version of jQuery to be included.

+
+ + + + +
+ +
+
+

About modals

+

A streamlined, but flexible, take on the traditional javascript modal plugin with only the minimum required functionality and smart defaults.

+ Download file +
+
+

Static example

+

Below is a statically rendered modal.

+
+ +
+ +

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.

+ + + Launch demo modal + +
+ +

Using bootstrap-modal

+

Call the modal via javascript:

+
$('#myModal').modal(options)
+

Options

+ + + + + + + + + + + + + + + + + + + + + + + +
Nametypedefaultdescription
backdropbooleantrueIncludes a modal-backdrop element
keyboardbooleantrueCloses the modal when escape key is pressed
+

Markup

+

You can activate modals on your page easily without having to write a single line of javascript. Just set data-toggle="modal" on a controller element with a data-target="#foo" or href="#foo" which corresponds to a modal element id, and when clicked, it will launch your modal.

+

Also, to add options to your modal instance, just include them as additional data attributes on either the control element or the modal markup itself.

+
+<a class="btn" data-toggle="modal" href="#myModal" >Launch Modal</a>
+
+ +
+<div class="modal">
+<div class="modal-header">
+<a href="#" class="close js-dismiss">×</a>
+<h3>Modal header</h3>
+</div>
+<div class="modal-body">
+<p>One fine body…</p>
+</div>
+<div class="modal-footer">
+<a href="#" class="btn primary">Save changes</a>
+<a href="#" class="btn">Close</a>
+</div>
+</div>
+
+

Notice If you want your modal to animate in and out, just add a .fade class to the .modal element (refer to the demo to see this in action).

+

Methods

+

.modal(options)

+

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

+$('#myModal').modal({
+keyboard: false
+})
+

.modal('toggle')

+

Manually toggles a modal.

+
$('#myModal').modal('toggle')
+

.modal('show')

+

Manually opens a modal.

+
$('#myModal').modal('show')
+

.modal('hide')

+

Manually hides a modal.

+
$('#myModal').modal('hide')
+

Events

+

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

+ + + + + + + + + + + + + + + + + + + + + + + + + +
EventDescription
showThis event fires immediately when the show instance method is called.
shownThis event is fired when the modal has been made visible to the user (will wait for css transitions to complete).
hideThis event is fired immediately when the hide instance method has been called.
hiddenThis event is fired when the modal has finished being hidden from the user (will wait for css transitions to complete).
+ +
+$('#myModal').on('hidden', function () {
+// do something ...
+})
+
+
+
+ + + + + + + + + +
+ +
+
+

The ScrollSpy plugin is for automatically updating nav targets based on scroll position.

+ Download file +
+
+

Example navbar with scrollspy

+

Scroll the area below and watch the navigation update. The dropdown sub items will be highlighted as well. Try it!

+ +
+

@fat

+

+ Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat. +

+

@mdo

+

+ Veniam marfa mustache skateboard, adipisicing fugiat velit pitchfork beard. Freegan beard aliqua cupidatat mcsweeney's vero. Cupidatat four loko nisi, ea helvetica nulla carles. Tattooed cosby sweater food truck, mcsweeney's quis non freegan vinyl. Lo-fi wes anderson +1 sartorial. Carles non aesthetic exercitation quis gentrify. Brooklyn adipisicing craft beer vice keytar deserunt. +

+

one

+

+ Occaecat commodo aliqua delectus. Fap craft beer deserunt skateboard ea. Lomo bicycle rights adipisicing banh mi, velit ea sunt next level locavore single-origin coffee in magna veniam. High life id vinyl, echo park consequat quis aliquip banh mi pitchfork. Vero VHS est adipisicing. Consectetur nisi DIY minim messenger bag. Cred ex in, sustainable delectus consectetur fanny pack iphone. +

+

two

+

+ In incididunt echo park, officia deserunt mcsweeney's proident master cleanse thundercats sapiente veniam. Excepteur VHS elit, proident shoreditch +1 biodiesel laborum craft beer. Single-origin coffee wayfarers irure four loko, cupidatat terry richardson master cleanse. Assumenda you probably haven't heard of them art party fanny pack, tattooed nulla cardigan tempor ad. Proident wolf nesciunt sartorial keffiyeh eu banh mi sustainable. Elit wolf voluptate, lo-fi ea portland before they sold out four loko. Locavore enim nostrud mlkshk brooklyn nesciunt. +

+

three

+

+ Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat. +

+

Keytar twee blog, culpa messenger bag marfa whatever delectus food truck. Sapiente synth id assumenda. Locavore sed helvetica cliche irony, thundercats you probably haven't heard of them consequat hoodie gluten-free lo-fi fap aliquip. Labore elit placeat before they sold out, terry richardson proident brunch nesciunt quis cosby sweater pariatur keffiyeh ut helvetica artisan. Cardigan craft beer seitan readymade velit. VHS chambray laboris tempor veniam. Anim mollit minim commodo ullamco thundercats. +

+
+
+

Using bootstrap-scrollspy.js

+

Call the scrollspy via javascript:

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

Markup

+

To easily add scrollspy behavior to your topbar navigation, just add data-spy="scroll" to the element you want to spy on (most typically this would be the body). +

<body data-spy="scroll" >...</body>
+

Notice Navbar anchor tags must have resolvable id targets. For example, a <a href="#home">home</a> must correspond to something in the dom like <div id="home"></div>. +

Options

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

This plugin adds quick, dynamic tab and pill functionality for transitioning through local content.

+ Download file +
+
+

Example tabs

+

Click the tabs below to toggle between hidden panes, 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.

+
+ + +
+
+

Using bootstrap-tab.js

+

Enable tabbable tabs via javascript:

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

Markup

+

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

+
+<ul class="tabs">
+<li><a href="#home" data-toggle="tab">Home</a></li>
+<li><a href="#profile" data-toggle="tab">Profile</a></li>
+<li><a href="#messages" data-toggle="tab">Messages</a></li>
+<li><a href="#ettings" 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. +

+
+<ul class="tabs">
+<li class="active"><a href="#home">Home</a></li>
+<li><a href="#profile">Profile</a></li>
+<li><a href="#messages">Messages</a></li>
+<li><a href="#settings">Settings</a></li>
+</ul>
+
+<div class="tab-content">
+<div class="active" id="home">...</div>
+<div id="profile">...</div>
+<div id="messages">...</div>
+<div id="settings">...</div>
+</div>
+
+<script>
+$(function () {
+$('.tabs a:last').tab('show')
+})
+</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.
+ +
+$('a[data-toggle="tab"]').on('shown', function (e) {
+e.target // activated tab
+e.relatedTarget // previous tab
+})
+
+
+
+ + + +
+ +
+
+

About Tooltips

+

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

+ Download file +
+
+

Example use of Tooltips

+

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

+
+
+

Using bootstrap-tooltip.js

+

Trigger the tooltip via javascript:

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

Options

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nametypedefaultdescription
animationbooleantrueapply a css fade transition to the tooltip
placementstring'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/hiding the tooltip (ms)

+

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

+

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

+
+

Notice Individual tooltip instance options 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

+

$().tooltip(options)

+

Attaches a tooltip handler to an element collection.

+

.tooltip('show')

+

Reveals an elements tooltip.

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

.tooltip('hide')

+

Hides an elements tooltip.

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

About popovers

+

Add small overlays of content, like those on the iPad, to any element for housing secondary information.

+

* Requires Tooltip to be included

+ Download file +
+
+

Example hover popover

+

Hover over the button to trigger the popover.

+ +
+

Using bootstrap-popover.js

+

Enable popovers via javascript:

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

Options

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nametypedefaultdescription
animationbooleantrueapply a css fade transition to the tooltip
placementstring'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 tooltip 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/hiding the popover (ms)

+

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

+

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

+
+

Notice Individual popover instance options 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 the 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')
+
+
+
+ + + + +
+ +
+
+

About alerts

+

The alert plugin is a tiny class for adding close functionality to alerts.

+ Download +
+
+

Example alerts

+

The alerts plugin works on regular alert messages, and block messages.

+
+ × + 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 +

+
+
+

Using bootstrap-alerts.js

+

Enable dismissal of an alert via javascript:

+
$(".alert-message").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-message").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 ...
+})
+
+
+
+ + + + +
+ +
+
+

About

+

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

+ Download file +
+
+

Example uses

+

Use the buttons plugin for states and toggles.

+ + + + + + + + + + + + + + + + + + + +
Stateful + +
Single toggle + +
Checkbox +
+ + + +
+
Radio +
+ + + +
+
+
+

Using bootstrap-button.js

+

Enable buttons via javascript:

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

Markup

+

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

+
+<!-- Add data-toggle="button" to activate toggling on a single button -->
+<button class="btn" data-toggle="button">Single Toggle</button>
+
+<!-- Add data-toggle="buttons-checkbox" for checkbox style toggling on btn-group -->
+<div class="btn-group" data-toggle="buttons-checkbox">
+<button class="btn">Left</button>
+<button class="btn">Middle</button>
+<button class="btn">Right</button>
+</div>
+
+<!-- Add data-toggle="buttons-radio" for radio style toggling on btn-group -->
+<div class="btn-group" data-toggle="buttons-radio">
+<button class="btn">Left</button>
+<button class="btn">Middle</button>
+<button class="btn">Right</button>
+</div>
+
+

Methods

+

$().button('toggle')

+

Toggles push state. Gives btn the look that it's been activated.

+

Notice You can enable auto toggling of a button by using the data-toggle attribute.

+
<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 class="btn" data-loading-text="loading stuff..." >...</button>
+

+ Notice Firefox persists the disabled state across page loads. A workaround for this is to use: autocomplete="off". More info can be found here. +

+

$().button('reset')

+

Resets button state - swaps text to original text.

+

$().button(string)

+

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

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

+ Download file +
+
+

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

Using bootstrap-collapse.js

+

Enable via javascript:

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

Options

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

Markup

+

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.

+
+<button class="btn danger" data-toggle="collapse" data-target="#demo">
+simple collapsible
+</button>
+
+<div id="demo" class="collapse in"> … </div>
+

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

+

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).
+ +
+$('#myCollapsible').on('hidden', function () {
+// do something ...
+})
+
+
+
+ + + + + + + + + +
+ +
+
+

About

+

A basic, easily extended plugin for quickly creating elegant typeaheads with any form text input.

+ Download file +
+
+

Example

+

Start typing in the field below to show the typeahead results.

+
+ +
+
+

Using bootstrap-typeahead.js

+

Call the typeahead via javascript:

+
$('.typeahead').typeahead()
+

Options

+ + + + + + + + + + + + + + + + + +
Nametypedefaultdescription
itemsnumber8The max number of items to display in the dropdown.
+ +

Markup

+

Add data attributes to register an element with typeahead functionality.

+
+<input type="text" data-provide="typeahead">
+
+
+
+
\ No newline at end of file -- cgit v1.2.3 From b4b1ef68398b68dcdfa29465d06cd76d6bf2c49d Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Mon, 23 Jan 2012 15:17:32 -0800 Subject: rebuild with new templates --- docs/templates/pages/javascript.mustache | 2338 +++++++++++++++--------------- 1 file changed, 1176 insertions(+), 1162 deletions(-) (limited to 'docs/templates/pages/javascript.mustache') diff --git a/docs/templates/pages/javascript.mustache b/docs/templates/pages/javascript.mustache index aefe87846..93789cc03 100644 --- a/docs/templates/pages/javascript.mustache +++ b/docs/templates/pages/javascript.mustache @@ -1,1299 +1,1313 @@ - -
-

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

+
- -
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
- -
-
-
-
-
- Download Source - - - - + +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ -
-
-
- Select/Unselect All Plugins -

Note: All plugins require the latest version of jQuery to be included.

-
+
+ Select/Unselect All Plugins +

Note: All plugins require the latest version of jQuery to be included.

+ - -
- -
-
-

About modals

-

A streamlined, but flexible, take on the traditional javascript modal plugin with only the minimum required functionality and smart defaults.

- Download file -
-
-

Static example

-

Below is a statically rendered modal.

-
- -
+ + + - - +

Methods

+

$().dropdown()

+

+ A programatic api for activating menus for a given navbar or tabbed navigation. +

+ + + - -
- -
-
-

The ScrollSpy plugin is for automatically updating nav targets based on scroll position.

- Download file -
-
-

Example navbar with scrollspy

-

Scroll the area below and watch the navigation update. The dropdown sub items will be highlighted as well. Try it!

- +
+

@fat

+

+ Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat. +

+

@mdo

+

+ Veniam marfa mustache skateboard, adipisicing fugiat velit pitchfork beard. Freegan beard aliqua cupidatat mcsweeney's vero. Cupidatat four loko nisi, ea helvetica nulla carles. Tattooed cosby sweater food truck, mcsweeney's quis non freegan vinyl. Lo-fi wes anderson +1 sartorial. Carles non aesthetic exercitation quis gentrify. Brooklyn adipisicing craft beer vice keytar deserunt. +

+

one

+

+ Occaecat commodo aliqua delectus. Fap craft beer deserunt skateboard ea. Lomo bicycle rights adipisicing banh mi, velit ea sunt next level locavore single-origin coffee in magna veniam. High life id vinyl, echo park consequat quis aliquip banh mi pitchfork. Vero VHS est adipisicing. Consectetur nisi DIY minim messenger bag. Cred ex in, sustainable delectus consectetur fanny pack iphone. +

+

two

+

+ In incididunt echo park, officia deserunt mcsweeney's proident master cleanse thundercats sapiente veniam. Excepteur VHS elit, proident shoreditch +1 biodiesel laborum craft beer. Single-origin coffee wayfarers irure four loko, cupidatat terry richardson master cleanse. Assumenda you probably haven't heard of them art party fanny pack, tattooed nulla cardigan tempor ad. Proident wolf nesciunt sartorial keffiyeh eu banh mi sustainable. Elit wolf voluptate, lo-fi ea portland before they sold out four loko. Locavore enim nostrud mlkshk brooklyn nesciunt. +

+

three

+

+ Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat. +

+

Keytar twee blog, culpa messenger bag marfa whatever delectus food truck. Sapiente synth id assumenda. Locavore sed helvetica cliche irony, thundercats you probably haven't heard of them consequat hoodie gluten-free lo-fi fap aliquip. Labore elit placeat before they sold out, terry richardson proident brunch nesciunt quis cosby sweater pariatur keffiyeh ut helvetica artisan. Cardigan craft beer seitan readymade velit. VHS chambray laboris tempor veniam. Anim mollit minim commodo ullamco thundercats. +

+
+
+

Using bootstrap-scrollspy.js

+

Call the scrollspy via javascript:

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

Markup

+

To easily add scrollspy behavior to your topbar navigation, just add data-spy="scroll" to the element you want to spy on (most typically this would be the body). +

<body data-spy="scroll" >...</body>
+

Notice Navbar anchor tags must have resolvable id targets. For example, a <a href="#home">home</a> must correspond to something in the dom like <div id="home"></div>. +

Options

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

@fat

-

- Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat. -

-

@mdo

-

- Veniam marfa mustache skateboard, adipisicing fugiat velit pitchfork beard. Freegan beard aliqua cupidatat mcsweeney's vero. Cupidatat four loko nisi, ea helvetica nulla carles. Tattooed cosby sweater food truck, mcsweeney's quis non freegan vinyl. Lo-fi wes anderson +1 sartorial. Carles non aesthetic exercitation quis gentrify. Brooklyn adipisicing craft beer vice keytar deserunt. -

-

one

-

- Occaecat commodo aliqua delectus. Fap craft beer deserunt skateboard ea. Lomo bicycle rights adipisicing banh mi, velit ea sunt next level locavore single-origin coffee in magna veniam. High life id vinyl, echo park consequat quis aliquip banh mi pitchfork. Vero VHS est adipisicing. Consectetur nisi DIY minim messenger bag. Cred ex in, sustainable delectus consectetur fanny pack iphone. -

-

two

-

- In incididunt echo park, officia deserunt mcsweeney's proident master cleanse thundercats sapiente veniam. Excepteur VHS elit, proident shoreditch +1 biodiesel laborum craft beer. Single-origin coffee wayfarers irure four loko, cupidatat terry richardson master cleanse. Assumenda you probably haven't heard of them art party fanny pack, tattooed nulla cardigan tempor ad. Proident wolf nesciunt sartorial keffiyeh eu banh mi sustainable. Elit wolf voluptate, lo-fi ea portland before they sold out four loko. Locavore enim nostrud mlkshk brooklyn nesciunt. -

-

three

-

- Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat. -

-

Keytar twee blog, culpa messenger bag marfa whatever delectus food truck. Sapiente synth id assumenda. Locavore sed helvetica cliche irony, thundercats you probably haven't heard of them consequat hoodie gluten-free lo-fi fap aliquip. Labore elit placeat before they sold out, terry richardson proident brunch nesciunt quis cosby sweater pariatur keffiyeh ut helvetica artisan. Cardigan craft beer seitan readymade velit. VHS chambray laboris tempor veniam. Anim mollit minim commodo ullamco thundercats. -

-
-
-

Using bootstrap-scrollspy.js

-

Call the scrollspy via javascript:

-
$('#navbar').scrollspy()
-

Markup

-

To easily add scrollspy behavior to your topbar navigation, just add data-spy="scroll" to the element you want to spy on (most typically this would be the body). -

<body data-spy="scroll" >...</body>
-

Notice Navbar anchor tags must have resolvable id targets. For example, a <a href="#home">home</a> must correspond to something in the dom like <div id="home"></div>. -

Options

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

This plugin adds quick, dynamic tab and pill functionality for transitioning through local content.

- Download file -
-
-

Example tabs

-

Click the tabs below to toggle between hidden panes, 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.

-
- - + +
+ -
-

Using bootstrap-tab.js

-

Enable tabbable tabs via javascript:

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

Markup

-

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

+
+
+

This plugin adds quick, dynamic tab and pill functionality for transitioning through local content.

+ Download file +
+
+

Example tabs

+

Click the tabs below to toggle between hidden panes, 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.

+
+ + +
+
+

Using bootstrap-tab.js

+

Enable tabbable tabs via javascript:

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

Markup

+

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

 <ul class="tabs">
-<li><a href="#home" data-toggle="tab">Home</a></li>
-<li><a href="#profile" data-toggle="tab">Profile</a></li>
-<li><a href="#messages" data-toggle="tab">Messages</a></li>
-<li><a href="#ettings" data-toggle="tab">Settings</a></li>
+  <li><a href="#home" data-toggle="tab">Home</a></li>
+  <li><a href="#profile" data-toggle="tab">Profile</a></li>
+  <li><a href="#messages" data-toggle="tab">Messages</a></li>
+  <li><a href="#ettings" 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="tabs">
-<li class="active"><a href="#home">Home</a></li>
-<li><a href="#profile">Profile</a></li>
-<li><a href="#messages">Messages</a></li>
-<li><a href="#settings">Settings</a></li>
+  <li class="active"><a href="#home">Home</a></li>
+  <li><a href="#profile">Profile</a></li>
+  <li><a href="#messages">Messages</a></li>
+  <li><a href="#settings">Settings</a></li>
 </ul>
 
 <div class="tab-content">
-<div class="active" id="home">...</div>
-<div id="profile">...</div>
-<div id="messages">...</div>
-<div id="settings">...</div>
+  <div class="active" id="home">...</div>
+  <div id="profile">...</div>
+  <div id="messages">...</div>
+  <div id="settings">...</div>
 </div>
 
 <script>
-$(function () {
-$('.tabs a:last').tab('show')
-})
+  $(function () {
+    $('.tabs a:last').tab('show')
+  })
 </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
+  e.target // activated tab
+  e.relatedTarget // previous tab
 })
-
-
-
+
+
+
- -
- -
-
-

About Tooltips

-

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

- Download file -
-
-

Example use of Tooltips

-

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

+ +
+ -
-

Using bootstrap-tooltip.js

-

Trigger the tooltip via javascript:

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

Options

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Nametypedefaultdescription
animationbooleantrueapply a css fade transition to the tooltip
placementstring'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/hiding the tooltip (ms)

-

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

-

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

-
-

Notice Individual tooltip instance options 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

-

$().tooltip(options)

-

Attaches a tooltip handler to an element collection.

-

.tooltip('show')

-

Reveals an elements tooltip.

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

.tooltip('hide')

-

Hides an elements tooltip.

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

About Tooltips

+

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

+ Download file +
+
+

Example use of Tooltips

+

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

+
+
+

Using bootstrap-tooltip.js

+

Trigger the tooltip via javascript:

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

Options

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nametypedefaultdescription
animationbooleantrueapply a css fade transition to the tooltip
placementstring'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/hiding the tooltip (ms)

+

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

+

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

+
+

Notice Individual tooltip instance options 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

+

$().tooltip(options)

+

Attaches a tooltip handler to an element collection.

+

.tooltip('show')

+

Reveals an elements tooltip.

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

.tooltip('hide')

+

Hides an elements tooltip.

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

About popovers

-

Add small overlays of content, like those on the iPad, to any element for housing secondary information.

-

* Requires Tooltip to be included

- Download file -
-
-

Example hover popover

-

Hover over the button to trigger the popover.

-
- hover for popover + +
+ -
-

Using bootstrap-popover.js

-

Enable popovers via javascript:

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

Options

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Nametypedefaultdescription
animationbooleantrueapply a css fade transition to the tooltip
placementstring'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 tooltip 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/hiding the popover (ms)

-

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

-

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

-
-

Notice Individual popover instance options 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 the 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')
-
-
-
+
+
+

About popovers

+

Add small overlays of content, like those on the iPad, to any element for housing secondary information.

+

* Requires Tooltip to be included

+ Download file +
+
+

Example hover popover

+

Hover over the button to trigger the popover.

+ +
+

Using bootstrap-popover.js

+

Enable popovers via javascript:

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

Options

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nametypedefaultdescription
animationbooleantrueapply a css fade transition to the tooltip
placementstring'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 tooltip 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/hiding the popover (ms)

+

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

+

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

+
+

Notice Individual popover instance options 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 the 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')
+
+
+ - -
- -
-
-

About alerts

-

The alert plugin is a tiny class for adding close functionality to alerts.

- Download -
-
-

Example alerts

-

The alerts plugin works on regular alert messages, and block messages.

-
- × - 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 -

-
-
-

Using bootstrap-alerts.js

-

Enable dismissal of an alert via javascript:

-
$(".alert-message").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-message").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).
+
+
+

About alerts

+

The alert plugin is a tiny class for adding close functionality to alerts.

+ Download +
+
+

Example alerts

+

The alerts plugin works on regular alert messages, and block messages.

+
+ × + 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 +

+
+
+

Using bootstrap-alerts.js

+

Enable dismissal of an alert via javascript:

+
$(".alert-message").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-message").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 ...
+  // do something ...
 })
-
-
-
+
+
+
- -
- -
-
-

About

-

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

- Download file -
-
-

Example uses

-

Use the buttons plugin for states and toggles.

- - - - - - - - - - - - - - - - - - - -
Stateful - -
Single toggle - -
Checkbox -
- - - -
-
Radio -
- - - -
-
-
-

Using bootstrap-button.js

-

Enable buttons via javascript:

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

Markup

-

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

+ +
+ +
+
+

About

+

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

+ Download file +
+
+

Example uses

+

Use the buttons plugin for states and toggles.

+ + + + + + + + + + + + + + + + + + + +
Stateful + +
Single toggle + +
Checkbox +
+ + + +
+
Radio +
+ + + +
+
+
+

Using bootstrap-button.js

+

Enable buttons via javascript:

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

Markup

+

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

 <!-- Add data-toggle="button" to activate toggling on a single button -->
 <button class="btn" data-toggle="button">Single Toggle</button>
 
 <!-- Add data-toggle="buttons-checkbox" for checkbox style toggling on btn-group -->
 <div class="btn-group" data-toggle="buttons-checkbox">
-<button class="btn">Left</button>
-<button class="btn">Middle</button>
-<button class="btn">Right</button>
+  <button class="btn">Left</button>
+  <button class="btn">Middle</button>
+  <button class="btn">Right</button>
 </div>
 
 <!-- Add data-toggle="buttons-radio" for radio style toggling on btn-group -->
 <div class="btn-group" data-toggle="buttons-radio">
-<button class="btn">Left</button>
-<button class="btn">Middle</button>
-<button class="btn">Right</button>
+  <button class="btn">Left</button>
+  <button class="btn">Middle</button>
+  <button class="btn">Right</button>
 </div>
 
-

Methods

-

$().button('toggle')

-

Toggles push state. Gives btn the look that it's been activated.

-

Notice You can enable auto toggling of a button by using the data-toggle attribute.

-
<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 class="btn" data-loading-text="loading stuff..." >...</button>
-

- Notice Firefox persists the disabled state across page loads. A workaround for this is to use: autocomplete="off". More info can be found here. -

-

$().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 btn the look that it's been activated.

+

Notice You can enable auto toggling of a button by using the data-toggle attribute.

+
<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 class="btn" data-loading-text="loading stuff..." >...</button>
+

+ Notice Firefox persists the disabled state across page loads. A workaround for this is to use: autocomplete="off". More info can be found here. +

+

$().button('reset')

+

Resets button state - swaps text to original text.

+

$().button(string)

+

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

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

About

-

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

- Download file -
-
-

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

About

+

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

+ Download file
-
- -
-
- 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. +
+

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

Using bootstrap-collapse.js

-

Enable via javascript:

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

Options

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

Markup

-

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.

-
+          
+          
+

Using bootstrap-collapse.js

+

Enable via javascript:

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

Options

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

Markup

+

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.

+
 <button class="btn danger" data-toggle="collapse" data-target="#demo">
-simple collapsible
+  simple collapsible
 </button>
 
 <div id="demo" class="collapse in"> … </div>
-

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

-

Methods

-

.collapse(options)

-

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

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

+

Methods

+

.collapse(options)

+

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

 $('#myCollapsible').collapse({
-toggle: false
+  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 ...
+  // do something ...
 })
-
-
-
+
+
+
- - +

.carousel('cycle')

+

Cycles through the carousel items from left to right.

+

.carousel('pause')

+

Stops the carousel from cycling through items.

+

.carousel(number)

+

Cycles the carousel to a particular frame (0 based, similar to an array).

+

.carousel('prev')

+

Cycles to the previous item.

+

.carousel('next')

+

Cycles to the next item.

+

Events

+

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

+ + + + + + + + + + + + + + + + + + +
EventDescription
slideThis event fires immediately when the slide instance method is invoked.
slidThis event is fired when the carousel has completed it's slide transition.
+ + + - -
- -
-
-

About

-

A basic, easily extended plugin for quickly creating elegant typeaheads with any form text input.

- Download file -
-
-

Example

-

Start typing in the field below to show the typeahead results.

-
- + +
+ -
-

Using bootstrap-typeahead.js

-

Call the typeahead via javascript:

-
$('.typeahead').typeahead()
-

Options

- - - - - - - - - - - - - - - - - -
Nametypedefaultdescription
itemsnumber8The max number of items to display in the dropdown.
+
+
+

About

+

A basic, easily extended plugin for quickly creating elegant typeaheads with any form text input.

+ Download file +
+
+

Example

+

Start typing in the field below to show the typeahead results.

+
+ +
+
+

Using bootstrap-typeahead.js

+

Call the typeahead via javascript:

+
$('.typeahead').typeahead()
+

Options

+ + + + + + + + + + + + + + + + + +
Nametypedefaultdescription
itemsnumber8The max number of items to display in the dropdown.
-

Markup

-

Add data attributes to register an element with typeahead functionality.

+

Markup

+

Add data attributes to register an element with typeahead functionality.

 <input type="text" data-provide="typeahead">
 
-
-
-
\ No newline at end of file +
+
+
\ No newline at end of file -- cgit v1.2.3 From 82de03b67cf729291ea5a73741e44838a42940f8 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Mon, 23 Jan 2012 19:55:00 -0800 Subject: start wrapping text in {{_i}} for translation --- docs/templates/pages/javascript.mustache | 460 +++++++++++++++---------------- 1 file changed, 229 insertions(+), 231 deletions(-) (limited to 'docs/templates/pages/javascript.mustache') diff --git a/docs/templates/pages/javascript.mustache b/docs/templates/pages/javascript.mustache index 93789cc03..e1856d6c2 100644 --- a/docs/templates/pages/javascript.mustache +++ b/docs/templates/pages/javascript.mustache @@ -1,21 +1,21 @@
-

Javascript for Bootstrap

-

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

{{_i}}Javascript for{{/i}} Bootstrap

+

{{_i}}Bring Bootstrap's components to life—now with 12 custom jQuery plugins.{{/i}}

@@ -24,105 +24,105 @@ ================================================== -->

- Select/Unselect All Plugins -

Note: All plugins require the latest version of jQuery to be included.

+ {{_i}}Select/Unselect All Plugins{{/i}} +

{{_i}}Note: All plugins require the latest version of jQuery to be included.{{/i}}

@@ -131,93 +131,93 @@ ================================================== -->
-

About modals

-

A streamlined, but flexible, take on the traditional javascript modal plugin with only the minimum required functionality and smart defaults.

- Download file +

{{_i}}About modals{{/i}}

+

{{_i}}A streamlined, but flexible, take on the traditional javascript modal plugin with only the minimum required functionality and smart defaults.{{/i}}

+ {{_i}}Download file{{/i}}
-

Static example

-

Below is a statically rendered modal.

+

{{_i}}Static example{{/i}}

+

{{_i}}Below is a statically rendered modal.{{/i}}

-

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.

+

{{_i}}Live demo{{/i}}

+

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

- Launch demo modal + {{_i}}Launch demo modal{{/i}}
-

Using bootstrap-modal

-

Call the modal via javascript:

+

{{_i}}Using bootstrap-modal{{/i}}

+

{{_i}}Call the modal via javascript:{{/i}}

$('#myModal').modal(options)
-

Options

+

{{_i}}Options{{/i}}

- - - - + + + + - - - - + + + + - - - - + + + +
Nametypedefaultdescription{{_i}}Name{{/i}}{{_i}}type{{/i}}{{_i}}default{{/i}}{{_i}}description{{/i}}
backdropbooleantrueIncludes a modal-backdrop element{{_i}}backdrop{{/i}}{{_i}}boolean{{/i}}{{_i}}true{{/i}}{{_i}}Includes a modal-backdrop element{{/i}}
keyboardbooleantrueCloses the modal when escape key is pressed{{_i}}keyboard{{/i}}{{_i}}boolean{{/i}}{{_i}}true{{/i}}{{_i}}Closes the modal when escape key is pressed{{/i}}
-

Markup

-

You can activate modals on your page easily without having to write a single line of javascript. Just set data-toggle="modal" on a controller element with a data-target="#foo" or href="#foo" which corresponds to a modal element id, and when clicked, it will launch your modal.

-

Also, to add options to your modal instance, just include them as additional data attributes on either the control element or the modal markup itself.

+

{{_i}}Markup{{/i}}

+

{{_i}}You can activate modals on your page easily without having to write a single line of javascript. Just set data-toggle="modal" on a controller element with a data-target="#foo" or href="#foo" which corresponds to a modal element id, and when clicked, it will launch your modal.

+

Also, to add options to your modal instance, just include them as additional data attributes on either the control element or the modal markup itself.{{/i}}

-<a class="btn" data-toggle="modal" href="#myModal" >Launch Modal</a>
+<a class="btn" data-toggle="modal" href="#myModal" >{{_i}}Launch Modal{{/i}}</a>
 
@@ -227,63 +227,63 @@
     <h3>Modal header</h3>
   </div>
   <div class="modal-body">
-    <p>One fine body…</p>
+    <p>{{_i}}One fine body…{{/i}}</p>
   </div>
   <div class="modal-footer">
-    <a href="#" class="btn primary">Save changes</a>
-    <a href="#" class="btn">Close</a>
+    <a href="#" class="btn primary">{{_i}}Save changes{{/i}}</a>
+    <a href="#" class="btn">{{_i}}Close{{/i}}</a>
   </div>
 </div>
 
-

Notice If you want your modal to animate in and out, just add a .fade class to the .modal element (refer to the demo to see this in action).

-

Methods

-

.modal(options)

-

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

{{_i}}Notice If you want your modal to animate in and out, just add a .fade class to the .modal element (refer to the demo to see this in action).{{/i}}

+ Methods{{/i}} +

.modal({{_i}}options{{/i}})

+

{{_i}}Activates your content as a modal. Accepts an optional options object.{{/i}}

 $('#myModal').modal({
   keyboard: false
 })

.modal('toggle')

-

Manually toggles a modal.

+

{{_i}}Manually toggles a modal.{{/i}}

$('#myModal').modal('toggle')

.modal('show')

-

Manually opens a modal.

+

{{_i}}Manually opens a modal.{{/i}}

$('#myModal').modal('show')

.modal('hide')

-

Manually hides a modal.

+

{{_i}}Manually hides a modal.{{/i}}

$('#myModal').modal('hide')
-

Events

-

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

+

{{_i}}Events{{/i}}

+

{{_i}}Bootstrap's modal class exposes a few events for hooking into modal functionality.{{/i}}

- - + + - - + + - - + + - - + + - - + +
EventDescription{{_i}}Event{{/i}}{{_i}}Description{{/i}}
showThis event fires immediately when the show instance method is called.{{_i}}show{{/i}}{{_i}}This event fires immediately when the show instance method is called.{{/i}}
shownThis event is fired when the modal has been made visible to the user (will wait for css transitions to complete).{{_i}}shown{{/i}}{{_i}}This event is fired when the modal has been made visible to the user (will wait for css transitions to complete).{{/i}}
hideThis event is fired immediately when the hide instance method has been called.{{_i}}hide{{/i}}{{_i}}This event is fired immediately when the hide instance method has been called.{{/i}}
hiddenThis event is fired when the modal has finished being hidden from the user (will wait for css transitions to complete).{{_i}}hidden{{/i}}{{_i}}This event is fired when the modal has finished being hidden from the user (will wait for css transitions to complete).{{/i}}
 $('#myModal').on('hidden', function () {
-  // do something ...
+  // {{_i}}do something…{{/i}}
 })
@@ -295,52 +295,52 @@ $('#myModal').on('hidden', function () { ================================================== --> @@ -424,30 +422,30 @@ $('#myModal').on('hidden', function () { ================================================== -->
-

The ScrollSpy plugin is for automatically updating nav targets based on scroll position.

- Download file +

{{_i}}The ScrollSpy plugin is for automatically updating nav targets based on scroll position.{{/i}}

+ {{_i}}Download file{{/i}}
-

Example navbar with scrollspy

-

Scroll the area below and watch the navigation update. The dropdown sub items will be highlighted as well. Try it!

+

{{_i}}Example navbar with scrollspy{{/i}}

+

{{_i}}Scroll the area below and watch the navigation update. The dropdown sub items will be highlighted as well. Try it!{{/i}}

-- cgit v1.2.3 From 7cbb5868259ef95aacbd16812c25ac73ea76ca2d Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Fri, 27 Jan 2012 22:27:06 -0800 Subject: move the matcher and sorter into the options - encourage people to override them... --- docs/templates/pages/javascript.mustache | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'docs/templates/pages/javascript.mustache') diff --git a/docs/templates/pages/javascript.mustache b/docs/templates/pages/javascript.mustache index 9113c1776..3c7a3b101 100644 --- a/docs/templates/pages/javascript.mustache +++ b/docs/templates/pages/javascript.mustache @@ -1288,7 +1288,7 @@ $('.myCarousel').carousel({ {{_i}}Name{{/i}} {{_i}}type{{/i}} - {{_i}}default{{/i}} + {{_i}}default{{/i}} {{_i}}description{{/i}} @@ -1305,6 +1305,18 @@ $('.myCarousel').carousel({ 8 {{_i}}The max number of items to display in the dropdown.{{/i}} + + {{_i}}matcher{{/i}} + {{_i}}function{{/i}} + case sensitive + {{_i}}The method used to determine if a query matches an item. Accepts a single argument, the item against which to test the query. Access the current query with this.query. Return a boolean true if query is a match.{{/i}} + + + {{_i}}sorter{{/i}} + {{_i}}function{{/i}} + no sort + {{_i}}Method used to sort autocomplete results. Accepts a single argument items and has the scope of the typeahead instance. Reference the current query with this.query.{{/i}} + @@ -1313,6 +1325,9 @@ $('.myCarousel').carousel({
 <input type="text" data-provide="typeahead">
 
+

{{_i}}Methods{{/i}}

+

.typeahead({{_i}}options{{/i}})

+

{{_i}}Initializes an input with a typahead.{{/i}}

\ No newline at end of file -- cgit v1.2.3 From 08fea7587c536b7daa2c976cdb50144379ae2a62 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Fri, 27 Jan 2012 23:27:33 -0800 Subject: call attention to notices in js docs more --- docs/templates/pages/javascript.mustache | 53 ++++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 16 deletions(-) (limited to 'docs/templates/pages/javascript.mustache') diff --git a/docs/templates/pages/javascript.mustache b/docs/templates/pages/javascript.mustache index 3c7a3b101..ee70bf21b 100644 --- a/docs/templates/pages/javascript.mustache +++ b/docs/templates/pages/javascript.mustache @@ -81,7 +81,7 @@ -
+
+
{{_i}}Heads up!{{/i}} {{_i}}All javascript plugins require the latest version of jQuery.{{/i}}
@@ -220,7 +221,9 @@ </div> </div> -

{{_i}}Notice If you want your modal to animate in and out, just add a .fade class to the .modal element (refer to the demo to see this in action).{{/i}}

+
+ {{_i}}Heads up!{{/i}} {{_i}}If you want your modal to animate in and out, just add a .fade class to the .modal element (refer to the demo to see this in action) and include bootstrap-transition.js.{{/i}} +
Methods{{/i}}

.modal({{_i}}options{{/i}})

{{_i}}Activates your content as a modal. Accepts an optional options object.{{/i}}

@@ -374,7 +377,9 @@ $('#myModal').on('hidden', function () {
$('.dropdown-toggle').dropdown()

{{_i}}Markup{{/i}}

{{_i}}To quickly add dropdown functionality to any element just add data-toggle="dropdown" and any valid bootstrap dropdown will automatically be activated.{{/i}}

-

{{_i}}Notice For added control and flexibility, optionally specify a data-target="#fat" or href="#fat" - this allows you to target specific dropdowns.{{/i}}

+
+ {{_i}}Heads up!{{/i}}{{_i}} You may optionally target a specific dropdown by using data-target="#fat" or href="#fat".{{/i}} +
 <ul class="nav pills">
@@ -468,7 +473,10 @@ $('#myModal').on('hidden', function () {
           

{{_i}}Markup{{/i}}

{{_i}}To easily add scrollspy behavior to your topbar navigation, just add data-spy="scroll" to the element you want to spy on (most typically this would be the body).{{/i}}

<body data-spy="scroll" >...</body>
-

{{_i}}Notice Navbar anchor tags must have resolvable id targets. For example, a <a href="#home">home</a> must correspond to something in the dom like <div id="home"></div>.{{/i}}

+
+ {{_i}}Heads up!{{/i}} + {{_i}}Navbar links must have resolvable id targets. For example, a <a href="#home">home</a> must correspond to something in the dom like <div id="home"></div>.{{/i}} +

{{_i}}Options{{/i}}

@@ -683,7 +691,10 @@ $('a[data-toggle="tab"]').on('shown', function (e) {
-

{{_i}}Notice Individual tooltip instance options can alternatively be specified through the use of data attributes.{{/i}}

+
+ {{_i}}Heads up!{{/i}} + {{_i}}Options for individual tooltips can alternatively be specified through the use of data attributes.{{/i}} +

{{_i}}Markup{{/i}}

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

{{_i}}Methods{{/i}}

@@ -792,7 +803,10 @@ $('a[data-toggle="tab"]').on('shown', function (e) { -

{{_i}}Notice Individual popover instance options can alternatively be specified through the use of data attributes.{{/i}}

+
+ {{_i}}Heads up!{{/i}} + {{_i}}Options for individual popovers can alternatively be specified through the use of data attributes.{{/i}} +

{{_i}}Markup{{/i}}

{{_i}}For performance reasons, the Tooltip and Popover data-apis are opt in. If you would like to use them just specify a the selector option.{{/i}} @@ -965,19 +979,23 @@ $('#my-alert').bind('closed', function () {

{{_i}}Methods{{/i}}

$().button('toggle')

{{_i}}Toggles push state. Gives btn the look that it's been activated.{{/i}}

-

{{_i}}Notice You can enable auto toggling of a button by using the data-toggle attribute.{{/i}}

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

$().button('loading')

{{_i}}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.{{/i}}

-
<button class="btn" data-loading-text="loading stuff..." >...</button>
-

- {{_i}}Notice Firefox persists the disabled state across page loads. A workaround for this is to use: autocomplete="off". More info can be found here.{{/i}} -

-

$().button('reset')

-

{{_i}}Resets button state - swaps text to original text.{{/i}}

-

$().button(string)

-

{{_i}}Resets button state - swaps text to any data defined text state.{{/i}}

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

$().button('reset')

+

{{_i}}Resets button state - swaps text to original text.{{/i}}

+

$().button(string)

+

{{_i}}Resets button state - swaps text to any data defined text state.{{/i}}

<button class="btn" data-complete-text="finished!" >...</button>
 <script>
   $('.btn').button('complete')
@@ -1081,7 +1099,10 @@ $('#my-alert').bind('closed', function () {
 </button>
 
 <div id="demo" class="collapse in"> … </div>
-

{{_i}}Notice To add accordion like group management to a collapsible control just add the additional data attribute data-parent="#selector". Refer to the demo below to see this in action.{{/i}}

+
+ {{_i}}Heads up!{{/i}} + {{_i}}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.{{/i}} +

{{_i}}Methods{{/i}}

.collapse({{_i}}options{{/i}})

{{_i}}Activates your content as a collapsible element. Accepts an optional options object.{{/i}} -- cgit v1.2.3 From 967030cb532c642f076d1e1fc4e5a1e2cee18561 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sat, 28 Jan 2012 00:39:22 -0800 Subject: modal refinements in docs and general responsiveness --- docs/templates/pages/javascript.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/templates/pages/javascript.mustache') diff --git a/docs/templates/pages/javascript.mustache b/docs/templates/pages/javascript.mustache index ee70bf21b..edafbbf0f 100644 --- a/docs/templates/pages/javascript.mustache +++ b/docs/templates/pages/javascript.mustache @@ -128,7 +128,7 @@

{{_i}}Static example{{/i}}

{{_i}}Below is a statically rendered modal.{{/i}}

-
+ -