update bootstrap to 3.0.0-rc2
[bootswatch] / bower_components / bootstrap / javascript.html
1 ---
2 layout: default
3 title: JavaScript
4 slug: js
5 lead: "Bring Bootstrap's components to life with over a dozen custom jQuery plugins. Easily include them all, or one by one."
6 base_url: "../"
7 ---
8
9
10   <!-- Overview
11   ================================================== -->
12   <div class="bs-docs-section">
13     <div class="page-header">
14       <h1 id="js-overview">Overview</h1>
15     </div>
16
17     <h3 id="js-individual-compiled">Individual or compiled</h3>
18     <p>Plugins can be included individually (using Bootstrap's individual <code>*.js</code> files), or all at once (using <code>bootstrap.js</code> or the minified <code>bootstrap.min.js</code>).</p>
19
20     <div class="bs-callout bs-callout-danger">
21       <h4>Do not attempt to include both.</h4>
22       <p>Both <code>bootstrap.js</code> and <code>bootstrap.min.js</code> contain all plugins in a single file.</p>
23     </div>
24
25     <div class="bs-callout bs-callout-danger">
26       <h4>Plugin dependencies</h4>
27       <p>Some plugins and CSS components depend on other plugins. If you include plugins individually, make sure to check for these dependencies in the docs. Also note that all plugins depend on jQuery (this means jQuery must be included <strong>before</strong> the plugin files).</p>
28     </div>
29
30     <h3 id="js-data-attrs">Data attributes</h3>
31     <p>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.</p>
32
33     <p>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 document namespaced with <code>data-api</code>. This looks like this:
34 {% highlight js %}
35 $(document).off('.data-api')
36 {% endhighlight %}
37
38     <p>Alternatively, to target a specific plugin, just include the plugin's name as a namespace along with the data-api namespace like this:</p>
39 {% highlight js %}
40 $(document).off('.alert.data-api')
41 {% endhighlight %}
42
43     <h3 id="js-programmatic-api">Programmatic API</h3>
44     <p>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.</p>
45 {% highlight js %}
46 $(".btn.danger").button("toggle").addClass("fat")
47 {% endhighlight %}
48
49     <p>All methods should accept an optional options object, a string which targets a particular method, or nothing (which initiates a plugin with default behavior):</p>
50 {% highlight js %}
51 $("#myModal").modal()                      // initialized with defaults
52 $("#myModal").modal({ keyboard: false })   // initialized with no keyboard
53 $("#myModal").modal('show')                // initializes and invokes show immediately</p>
54 {% endhighlight %}
55
56     <p>Each plugin also exposes its raw constructor on a <code>Constructor</code> property: <code>$.fn.popover.Constructor</code>. If you'd like to get a particular plugin instance, retrieve it directly from an element: <code>$('[rel=popover]').data('popover')</code>.</p>
57
58     <h3 id="js-noconflict">No conflict</h3>
59     <p>Sometimes it is necessary to use Bootstrap plugins with other UI frameworks. In these circumstances, namespace collisions can occasionally occur. If this happens, you may call <code>.noConflict</code> on the plugin you wish to revert the value of.</p>
60 {% highlight js %}
61 var bootstrapButton = $.fn.button.noConflict() // return $.fn.button to previously assigned value
62 $.fn.bootstrapBtn = bootstrapButton            // give $().bootstrapBtn the Bootstrap functionality
63 {% endhighlight %}
64
65     <h3 id="js-events">Events</h3>
66     <p>Bootstrap provides custom events for most plugin's unique actions. Generally, these come in an infinitive and past participle form - where the infinitive (ex. <code>show</code>) is triggered at the start of an event, and its past participle form (ex. <code>shown</code>) is trigger on the completion of an action.</p>
67     <p>As of 3.0.0, all Bootstrap events are namespaced.</p>
68     <p>All infinitive events provide <code>preventDefault</code> functionality. This provides the ability to stop the execution of an action before it starts.</p>
69 {% highlight js %}
70 $('#myModal').on('show.bs.modal', function (e) {
71   if (!data) return e.preventDefault() // stops modal from being shown
72 })
73 {% endhighlight %}
74
75     <div class="bs-callout bs-callout-warning" id="callout-third-party-libs">
76       <h4>Third-party libraries</h4>
77       <p><strong>Bootstrap does not officially support third-party JavaScript libraries</strong> like Prototype or jQuery UI. Despite <code>.noConflict</code> and namespaced events, there may be compatibility problems that you need to fix on your own. Ask on the <a href="http://groups.google.com/group/twitter-bootstrap">mailing list</a> if you need help.</p>
78     </div>
79   </div>
80
81
82
83   <!-- Transitions
84   ================================================== -->
85   <div class="bs-docs-section">
86     <div class="page-header">
87       <h1 id="transitions">Transitions <small>transition.js</small></h1>
88     </div>
89     <h3>About transitions</h3>
90     <p>For simple transition effects, include <code>transition.js</code> once alongside the other JS files. If you're using the compiled (or minified) <code>bootstrap.js</code>, there is no need to include this&mdash;it's already there.</p>
91     <h3>What's inside</h3>
92     <p>Transition.js is a basic helper for <code>transitionEnd</code> events as well as a CSS transition emulator. It's used by the other plugins to check for CSS transition support and to catch hanging transitions.</p>
93   </div>
94
95
96
97   <!-- Modal
98   ================================================== -->
99   <div class="bs-docs-section">
100     <div class="page-header">
101       <h1 id="modals">Modals <small>modal.js</small></h1>
102     </div>
103
104     <h2 id="modals-examples">Examples</h2>
105     <p>Modals are streamlined, but flexible, dialog prompts with the minimum required functionality and smart defaults.</p>
106
107     <h3>Static example</h3>
108     <p>A rendered modal with header, body, and set of actions in the footer.</p>
109     <div class="bs-example bs-example-modal">
110       <div class="modal">
111         <div class="modal-dialog">
112           <div class="modal-content">
113             <div class="modal-header">
114               <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
115               <h4 class="modal-title">Modal title</h4>
116             </div>
117             <div class="modal-body">
118               <p>One fine body&hellip;</p>
119             </div>
120             <div class="modal-footer">
121               <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
122               <button type="button" class="btn btn-primary">Save changes</button>
123             </div>
124           </div><!-- /.modal-content -->
125         </div><!-- /.modal-dialog -->
126       </div><!-- /.modal -->
127     </div><!-- /example -->
128 {% highlight html %}
129 <div class="modal fade">
130   <div class="modal-dialog">
131     <div class="modal-content">
132       <div class="modal-header">
133         <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
134         <h4 class="modal-title">Modal title</h4>
135       </div>
136       <div class="modal-body">
137         <p>One fine body&hellip;</p>
138       </div>
139       <div class="modal-footer">
140         <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
141         <button type="button" class="btn btn-primary">Save changes</button>
142       </div>
143     </div><!-- /.modal-content -->
144   </div><!-- /.modal-dialog -->
145 </div><!-- /.modal -->
146 {% endhighlight %}
147
148     <h3>Live demo</h3>
149     <p>Toggle a modal via JavaScript by clicking the button below. It will slide down and fade in from the top of the page.</p>
150     <!-- sample modal content -->
151     <div id="myModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
152       <div class="modal-dialog">
153         <div class="modal-content">
154
155           <div class="modal-header">
156             <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
157             <h4 class="modal-title" id="myModalLabel">Modal Heading</h4>
158           </div>
159           <div class="modal-body">
160             <h4>Text in a modal</h4>
161             <p>Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</p>
162
163             <h4>Popover in a modal</h4>
164             <p>This <a href="#" role="button" class="btn btn-default popover-test" title="A Title" data-content="And here's some amazing content. It's very engaging. right?">button</a> should trigger a popover on click.</p>
165
166             <h4>Tooltips in a modal</h4>
167             <p><a href="#" class="tooltip-test" title="Tooltip">This link</a> and <a href="#" class="tooltip-test" title="Tooltip">that link</a> should have tooltips on hover.</p>
168
169             <hr>
170
171             <h4>Overflowing text to show scroll behavior</h4>
172             <p>Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</p>
173             <p>Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</p>
174             <p>Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.</p>
175             <p>Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</p>
176             <p>Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</p>
177             <p>Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.</p>
178             <p>Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</p>
179             <p>Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</p>
180             <p>Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.</p>
181           </div>
182           <div class="modal-footer">
183             <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
184             <button type="button" class="btn btn-primary">Save changes</button>
185           </div>
186
187         </div><!-- /.modal-content -->
188       </div><!-- /.modal-dialog -->
189     </div><!-- /.modal -->
190
191     <div class="bs-example" style="padding-bottom: 24px;">
192       <a data-toggle="modal" href="#myModal" class="btn btn-primary btn-lg">Launch demo modal</a>
193     </div><!-- /example -->
194 {% highlight html %}
195   <!-- Button trigger modal -->
196   <a data-toggle="modal" href="#myModal" class="btn btn-primary btn-lg">Launch demo modal</a>
197
198   <!-- Modal -->
199   <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
200     <div class="modal-dialog">
201       <div class="modal-content">
202         <div class="modal-header">
203           <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
204           <h4 class="modal-title">Modal title</h4>
205         </div>
206         <div class="modal-body">
207           ...
208         </div>
209         <div class="modal-footer">
210           <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
211           <button type="button" class="btn btn-primary">Save changes</button>
212         </div>
213       </div><!-- /.modal-content -->
214     </div><!-- /.modal-dialog -->
215   </div><!-- /.modal -->
216 {% endhighlight %}
217
218
219     <div class="bs-callout bs-callout-warning">
220       <h4>Make modals accessible</h4>
221       <p>
222         Be sure to add <code>role="dialog"</code> to your primary modal div. In the example above, <code>div#myModal</code>.<br>
223         Also, the <code>aria-labelledby</code> attribute references your modal title. In this example, <code>h4#myModalLabel</code>.<br>
224         Finally, <code>aria-hidden="true"</code> tells assistive technologies to skip DOM elements.<br>
225         Additionally, you may give a description of your modal dialog. Use the <code>aria-describedby</code> attribute in the modal's primary <code>&lt;div&gt;</code> to point to this description (this is not shown in the above example).
226       </p>
227     </div>
228
229     <h2 id="modals-usage">Usage</h2>
230
231     <h3>Via data attributes</h3>
232     <p>Activate a modal without writing JavaScript. Set <code>data-toggle="modal"</code> on a controller element, like a button, along with a <code>data-target="#foo"</code> or <code>href="#foo"</code> to target a specific modal to toggle.</p>
233 {% highlight html %}
234 <button type="button" data-toggle="modal" data-target="#myModal">Launch modal</button>
235 {% endhighlight %}
236
237     <h3>Via JavaScript</h3>
238     <p>Call a modal with id <code>myModal</code> with a single line of JavaScript:</p>
239     {% highlight js %}$('#myModal').modal(options){% endhighlight %}
240
241     <h3>Options</h3>
242     <p>Options can be passed via data attributes or JavaScript. For data attributes, append the option name to <code>data-</code>, as in <code>data-backdrop=""</code>.</p>
243     <div class="bs-table-scrollable">
244       <table class="table table-bordered table-striped">
245         <thead>
246          <tr>
247            <th style="width: 100px;">Name</th>
248            <th style="width: 50px;">type</th>
249            <th style="width: 50px;">default</th>
250            <th>description</th>
251          </tr>
252         </thead>
253         <tbody>
254          <tr>
255            <td>backdrop</td>
256            <td>boolean</td>
257            <td>true</td>
258            <td>Includes a modal-backdrop element. Alternatively, specify <code>static</code> for a backdrop which doesn't close the modal on click.</td>
259          </tr>
260          <tr>
261            <td>keyboard</td>
262            <td>boolean</td>
263            <td>true</td>
264            <td>Closes the modal when escape key is pressed</td>
265          </tr>
266          <tr>
267            <td>show</td>
268            <td>boolean</td>
269            <td>true</td>
270            <td>Shows the modal when initialized.</td>
271          </tr>
272          <tr>
273            <td>remote</td>
274            <td>path</td>
275            <td>false</td>
276            <td><p>If a remote URL is provided, content will be loaded via jQuery's <code>load</code> method and injected into the root of the modal element. If you're using the data api, you may alternatively use the <code>href</code> attribute to specify the remote source. An example of this is shown below:</p>
277 {% highlight html %}
278 <a data-toggle="modal" href="remote.html" data-target="#modal">Click me</a>
279 {% endhighlight %}
280          </tr>
281         </tbody>
282       </table>
283     </div><!-- /.bs-table-scrollable -->
284
285     <h3>Methods</h3>
286
287     <h4>.modal(options)</h4>
288     <p>Activates your content as a modal. Accepts an optional options <code>object</code>.</p>
289 {% highlight js %}
290 $('#myModal').modal({
291   keyboard: false
292 })
293 {% endhighlight %}
294
295     <h4>.modal('toggle')</h4>
296     <p>Manually toggles a modal.</p>
297     {% highlight js %}$('#myModal').modal('toggle'){% endhighlight %}
298
299     <h4>.modal('show')</h4>
300     <p>Manually opens a modal.</p>
301     {% highlight js %}$('#myModal').modal('show'){% endhighlight %}
302
303     <h4>.modal('hide')</h4>
304     <p>Manually hides a modal.</p>
305     {% highlight js %}$('#myModal').modal('hide'){% endhighlight %}
306
307     <h3>Events</h3>
308     <p>Bootstrap's modal class exposes a few events for hooking into modal functionality.</p>
309     <div class="bs-table-scrollable">
310       <table class="table table-bordered table-striped">
311         <thead>
312          <tr>
313            <th style="width: 150px;">Event Type</th>
314            <th>Description</th>
315          </tr>
316         </thead>
317         <tbody>
318          <tr>
319            <td>show.bs.modal</td>
320            <td>This event fires immediately when the <code>show</code> instance method is called.</td>
321          </tr>
322          <tr>
323            <td>shown.bs.modal</td>
324            <td>This event is fired when the modal has been made visible to the user (will wait for CSS transitions to complete).</td>
325          </tr>
326          <tr>
327            <td>hide.bs.modal</td>
328            <td>This event is fired immediately when the <code>hide</code> instance method has been called.</td>
329          </tr>
330          <tr>
331            <td>hidden.bs.modal</td>
332            <td>This event is fired when the modal has finished being hidden from the user (will wait for CSS transitions to complete).</td>
333          </tr>
334         </tbody>
335       </table>
336     </div><!-- /.bs-table-scrollable -->
337 {% highlight js %}
338 $('#myModal').on('hidden.bs.modal', function () {
339   // do something…
340 })
341 {% endhighlight %}
342   </div>
343
344
345
346   <!-- Dropdowns
347   ================================================== -->
348   <div class="bs-docs-section">
349     <div class="page-header">
350       <h1 id="dropdowns">Dropdowns <small>dropdown.js</small></h1>
351     </div>
352
353     <h2 id="dropdowns-examples">Examples</h2>
354     <p>Add dropdown menus to nearly anything with this simple plugin, including the navbar, tabs, and pills.</p>
355
356     <h3>Within a navbar</h3>
357     <div class="bs-example">
358       <nav id="navbar-example" class="navbar navbar-static" role="navigation">
359         <div class="navbar-header">
360           <button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".bs-js-navbar-collapse">
361             <span class="sr-only">Toggle navigation</span>
362             <span class="icon-bar"></span>
363             <span class="icon-bar"></span>
364             <span class="icon-bar"></span>
365           </button>
366           <a class="navbar-brand" href="#">Project Name</a>
367         </div>
368         <div class="collapse navbar-collapse bs-js-navbar-collapse">
369           <ul class="nav navbar-nav">
370             <li class="dropdown">
371               <a id="drop1" href="#" role="button" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
372               <ul class="dropdown-menu" role="menu" aria-labelledby="drop1">
373                 <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Action</a></li>
374                 <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Another action</a></li>
375                 <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Something else here</a></li>
376                 <li role="presentation" class="divider"></li>
377                 <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Separated link</a></li>
378               </ul>
379             </li>
380             <li class="dropdown">
381               <a href="#" id="drop2" role="button" class="dropdown-toggle" data-toggle="dropdown">Dropdown 2 <b class="caret"></b></a>
382               <ul class="dropdown-menu" role="menu" aria-labelledby="drop2">
383                 <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Action</a></li>
384                 <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Another action</a></li>
385                 <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Something else here</a></li>
386                 <li role="presentation" class="divider"></li>
387                 <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Separated link</a></li>
388               </ul>
389             </li>
390           </ul>
391           <ul class="nav navbar-nav navbar-right">
392             <li id="fat-menu" class="dropdown">
393               <a href="#" id="drop3" role="button" class="dropdown-toggle" data-toggle="dropdown">Dropdown 3 <b class="caret"></b></a>
394               <ul class="dropdown-menu" role="menu" aria-labelledby="drop3">
395                 <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Action</a></li>
396                 <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Another action</a></li>
397                 <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Something else here</a></li>
398                 <li role="presentation" class="divider"></li>
399                 <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Separated link</a></li>
400               </ul>
401             </li>
402           </ul>
403         </div><!-- /.nav-collapse -->
404       </nav> <!-- /navbar-example -->
405     </div> <!-- /example -->
406
407     <h3>Within tabs</h3>
408     <div class="bs-example">
409       <ul class="nav nav-pills">
410         <li class="active"><a href="#">Regular link</a></li>
411         <li class="dropdown">
412           <a id="drop4" role="button" data-toggle="dropdown" href="#">Dropdown <b class="caret"></b></a>
413           <ul id="menu1" class="dropdown-menu" role="menu" aria-labelledby="drop4">
414             <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Action</a></li>
415             <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Another action</a></li>
416             <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Something else here</a></li>
417             <li role="presentation" class="divider"></li>
418             <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Separated link</a></li>
419           </ul>
420         </li>
421         <li class="dropdown">
422           <a id="drop5" role="button" data-toggle="dropdown" href="#">Dropdown 2 <b class="caret"></b></a>
423           <ul id="menu2" class="dropdown-menu" role="menu" aria-labelledby="drop5">
424             <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Action</a></li>
425             <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Another action</a></li>
426             <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Something else here</a></li>
427             <li role="presentation" class="divider"></li>
428             <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Separated link</a></li>
429           </ul>
430         </li>
431         <li class="dropdown">
432           <a id="drop6" role="button" data-toggle="dropdown" href="#">Dropdown 3 <b class="caret"></b></a>
433           <ul id="menu3" class="dropdown-menu" role="menu" aria-labelledby="drop6">
434             <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Action</a></li>
435             <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Another action</a></li>
436             <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Something else here</a></li>
437             <li role="presentation" class="divider"></li>
438             <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Separated link</a></li>
439           </ul>
440         </li>
441       </ul> <!-- /tabs -->
442     </div> <!-- /example -->
443
444
445     <h2 id="dropdowns-usage">Usage</h2>
446
447     <h3>Via data attributes</h3>
448     <p>Add <code>data-toggle="dropdown"</code> to a link or button to toggle a dropdown.</p>
449 {% highlight html %}
450 <div class="dropdown">
451   <a data-toggle="dropdown" href="#">Dropdown trigger</a>
452   <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
453     ...
454   </ul>
455 </div>
456 {% endhighlight %}
457           <p>To keep URLs intact, use the <code>data-target</code> attribute instead of <code>href="#"</code>.</p>
458 {% highlight html %}
459 <div class="dropdown">
460   <a id="dLabel" role="button" data-toggle="dropdown" data-target="#" href="/page.html">
461     Dropdown <span class="caret"></span>
462   </a>
463   <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
464     ...
465   </ul>
466 </div>
467 {% endhighlight %}
468
469     <h3>Via JavaScript</h3>
470     <p>Call the dropdowns via JavaScript:</p>
471 {% highlight js %}
472 $('.dropdown-toggle').dropdown()
473 {% endhighlight %}
474
475     <h3>Options</h3>
476     <p><em>None</em></p>
477
478     <h3>Methods</h3>
479     <h4>$().dropdown('toggle')</h4>
480     <p>Toggles the dropdown menu of a given navbar or tabbed navigation.</p>
481
482     <h3>Events</h3>
483     <div class="bs-table-scrollable">
484       <table class="table table-bordered table-striped">
485         <thead>
486           <tr>
487             <th style="width: 150px;">Event Type</th>
488             <th>Description</th>
489           </tr>
490         </thead>
491         <tbody>
492           <tr>
493             <td>show.bs.dropdown</td>
494             <td>This event fires immediately when the show instance method is called.</td>
495           </tr>
496           <tr>
497             <td>shown.bs.dropdown</td>
498             <td>This event is fired when the dropdown has been made visible to the user (will wait for CSS transitions, to complete).</td>
499           </tr>
500           <tr>
501             <td>hide.bs.dropdown</td>
502             <td>This event is fired immediately when the hide instance method has been called.</td>
503           </tr>
504           <tr>
505             <td>hidden.bs.dropdown</td>
506             <td>This event is fired when the dropdown has finished being hidden from the user (will wait for CSS transitions, to complete).</td>
507           </tr>
508         </tbody>
509       </table>
510     </div><!-- ./bs-table-scrollable -->
511 {% highlight js %}
512 $('#myDropdown').on('show.bs.dropdown', function () {
513   // do something…
514 })
515 {% endhighlight %}
516   </div>
517
518   <!-- ScrollSpy
519   ================================================== -->
520   <div class="bs-docs-section">
521     <div class="page-header">
522       <h1 id="scrollspy">ScrollSpy <small>scrollspy.js</small></h1>
523     </div>
524
525
526     <h2 id="scrollspy-examples">Example in navbar</h2>
527     <p>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.</p>
528     <div class="bs-example">
529       <nav id="navbar-example2" class="navbar navbar-static" role="navigation">
530         <div class="navbar-header">
531           <button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".bs-js-navbar-scrollspy">
532             <span class="sr-only">Toggle navigation</span>
533             <span class="icon-bar"></span>
534             <span class="icon-bar"></span>
535             <span class="icon-bar"></span>
536           </button>
537           <a class="navbar-brand" href="#">Project Name</a>
538         </div>
539         <div class="collapse navbar-collapse bs-js-navbar-scrollspy">
540           <ul class="nav navbar-nav">
541             <li><a href="#fat">@fat</a></li>
542             <li><a href="#mdo">@mdo</a></li>
543             <li class="dropdown">
544               <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
545               <ul class="dropdown-menu">
546                 <li><a href="#one">one</a></li>
547                 <li><a href="#two">two</a></li>
548                 <li class="divider"></li>
549                 <li><a href="#three">three</a></li>
550               </ul>
551             </li>
552           </ul>
553         </div>
554       </nav>
555       <div data-spy="scroll" data-target="#navbar-example2" data-offset="0" class="scrollspy-example">
556         <h4 id="fat">@fat</h4>
557         <p>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.</p>
558         <h4 id="mdo">@mdo</h4>
559         <p>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.</p>
560         <h4 id="one">one</h4>
561         <p>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.</p>
562         <h4 id="two">two</h4>
563         <p>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.</p>
564         <h4 id="three">three</h4>
565         <p>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.</p>
566         <p>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.
567         </p>
568       </div>
569     </div><!-- /example -->
570
571
572     <h2 id="scrollspy-usage">Usage</h2>
573
574     <h3>Via data attributes</h3>
575     <p>To easily add scrollspy behavior to your topbar navigation, add <code>data-spy="scroll"</code> to the element you want to spy on (most typically this would be the <code>&lt;body&gt;</code>. Then add the <code>data-target</code> attribute with the ID or class of the parent element of any Bootstrap <code>.nav</code> component.</p>
576 {% highlight html %}
577 <body data-spy="scroll" data-target="#navbar-example">
578   ...
579 </body>
580 {% endhighlight %}
581
582     <h3>Via JavaScript</h3>
583     <p>Call the scrollspy via JavaScript:</p>
584 {% highlight js %}
585 $('body').scrollspy({ target: '#navbar-example' })
586 {% endhighlight %}
587
588     <div class="bs-callout bs-callout-danger">
589       <h4>Resolvable ID targets required</h4>
590       <p>Navbar links must have resolvable id targets. For example, a <code>&lt;a href="#home"&gt;home&lt;/a&gt;</code> must correspond to something in the DOM like <code>&lt;div id="home"&gt;&lt;/div&gt;</code>.</p>
591     </div>
592
593     <h3>Methods</h3>
594     <h4>.scrollspy('refresh')</h4>
595     <p>When using scrollspy in conjunction with adding or removing of elements from the DOM, you'll need to call the refresh method like so:</p>
596 {% highlight js %}
597 $('[data-spy="scroll"]').each(function () {
598   var $spy = $(this).scrollspy('refresh')
599 })
600 {% endhighlight %}
601
602
603     <h3>Options</h3>
604     <p>Options can be passed via data attributes or JavaScript. For data attributes, append the option name to <code>data-</code>, as in <code>data-offset=""</code>.</p>
605     <div class="bs-table-scrollable">
606       <table class="table table-bordered table-striped">
607         <thead>
608          <tr>
609            <th style="width: 100px;">Name</th>
610            <th style="width: 100px;">type</th>
611            <th style="width: 50px;">default</th>
612            <th>description</th>
613          </tr>
614         </thead>
615         <tbody>
616          <tr>
617            <td>offset</td>
618            <td>number</td>
619            <td>10</td>
620            <td>Pixels to offset from top when calculating position of scroll.</td>
621          </tr>
622         </tbody>
623       </table>
624     </div><!-- ./bs-table-scrollable -->
625
626     <h3>Events</h3>
627     <div class="bs-table-scrollable">
628       <table class="table table-bordered table-striped">
629         <thead>
630          <tr>
631            <th style="width: 150px;">Event Type</th>
632            <th>Description</th>
633          </tr>
634         </thead>
635         <tbody>
636          <tr>
637            <td>activate.bs.scrollspy</td>
638            <td>This event fires whenever a new item becomes activated by the scrollspy.</td>
639         </tr>
640         </tbody>
641       </table>
642     </div><!-- ./bs-table-scrollable -->
643 {% highlight js %}
644 $('#myScrollspy').on('activate.bs.scrollspy', function () {
645   // do something…
646 })
647 {% endhighlight %}
648   </div>
649
650
651
652   <!-- Tabs
653   ================================================== -->
654   <div class="bs-docs-section">
655     <div class="page-header">
656       <h1 id="tabs">Togglable tabs <small>tab.js</small></h1>
657     </div>
658
659     <h2 id="tabs-examples">Example tabs</h2>
660     <p>Add quick, dynamic tab functionality to transition through panes of local content, even via dropdown menus.</p>
661     <div class="bs-example bs-example-tabs">
662       <ul id="myTab" class="nav nav-tabs">
663         <li class="active"><a href="#home" data-toggle="tab">Home</a></li>
664         <li><a href="#profile" data-toggle="tab">Profile</a></li>
665         <li class="dropdown">
666           <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
667           <ul class="dropdown-menu">
668             <li><a href="#dropdown1" data-toggle="tab">@fat</a></li>
669             <li><a href="#dropdown2" data-toggle="tab">@mdo</a></li>
670           </ul>
671         </li>
672       </ul>
673       <div id="myTabContent" class="tab-content">
674         <div class="tab-pane fade in active" id="home">
675           <p>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.</p>
676         </div>
677         <div class="tab-pane fade" id="profile">
678           <p>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.</p>
679         </div>
680         <div class="tab-pane fade" id="dropdown1">
681           <p>Etsy mixtape wayfarers, ethical wes anderson tofu before they sold out mcsweeney's organic lomo retro fanny pack lo-fi farm-to-table readymade. Messenger bag gentrify pitchfork tattooed craft beer, iphone skateboard locavore carles etsy salvia banksy hoodie helvetica. DIY synth PBR banksy irony. Leggings gentrify squid 8-bit cred pitchfork. Williamsburg banh mi whatever gluten-free, carles pitchfork biodiesel fixie etsy retro mlkshk vice blog. Scenester cred you probably haven't heard of them, vinyl craft beer blog stumptown. Pitchfork sustainable tofu synth chambray yr.</p>
682         </div>
683         <div class="tab-pane fade" id="dropdown2">
684           <p>Trust fund seitan letterpress, keytar raw denim keffiyeh etsy art party before they sold out master cleanse gluten-free squid scenester freegan cosby sweater. Fanny pack portland seitan DIY, art party locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi before they sold out farm-to-table VHS viral locavore cosby sweater. Lomo wolf viral, mustache readymade thundercats keffiyeh craft beer marfa ethical. Wolf salvia freegan, sartorial keffiyeh echo park vegan.</p>
685         </div>
686       </div>
687     </div><!-- /example -->
688
689
690     <h2 id="tabs-usage">Usage</h2>
691     <p>Enable tabbable tabs via JavaScript (each tab needs to be activated individually):</p>
692 {% highlight js %}
693 $('#myTab a').click(function (e) {
694   e.preventDefault()
695   $(this).tab('show')
696 })
697 {% endhighlight %}
698
699           <p>You can activate individual tabs in several ways:</p>
700 {% highlight js %}
701 $('#myTab a[href="#profile"]').tab('show') // Select tab by name
702 $('#myTab a:first').tab('show') // Select first tab
703 $('#myTab a:last').tab('show') // Select last tab
704 $('#myTab li:eq(2) a').tab('show') // Select third tab (0-indexed)
705 {% endhighlight %}
706
707     <h3>Markup</h3>
708     <p>You can activate a tab or pill navigation without writing any JavaScript by simply specifying <code>data-toggle="tab"</code> or <code>data-toggle="pill"</code> on an element. Adding the <code>nav</code> and <code>nav-tabs</code> classes to the tab <code>ul</code> will apply the Bootstrap tab styling.</p>
709 {% highlight html %}
710 <ul class="nav nav-tabs">
711   <li><a href="#home" data-toggle="tab">Home</a></li>
712   <li><a href="#profile" data-toggle="tab">Profile</a></li>
713   <li><a href="#messages" data-toggle="tab">Messages</a></li>
714   <li><a href="#settings" data-toggle="tab">Settings</a></li>
715 </ul>
716 {% endhighlight %}
717
718     <p>To make tabs fade in, add <code>.fade</code> to each <code>.tab-pane</code>.</p>
719
720     <h3>Methods</h3>
721     <h4>$().tab</h4>
722     <p>
723       Activates a tab element and content container. Tab should have either a <code>data-target</code> or an <code>href</code> targeting a container node in the DOM.
724     </p>
725 {% highlight html %}
726 <ul class="nav nav-tabs" id="myTab">
727   <li class="active"><a href="#home">Home</a></li>
728   <li><a href="#profile">Profile</a></li>
729   <li><a href="#messages">Messages</a></li>
730   <li><a href="#settings">Settings</a></li>
731 </ul>
732
733 <div class="tab-content">
734   <div class="tab-pane active" id="home">...</div>
735   <div class="tab-pane" id="profile">...</div>
736   <div class="tab-pane" id="messages">...</div>
737   <div class="tab-pane" id="settings">...</div>
738 </div>
739
740 <script>
741   $(function () {
742     $('#myTab a:last').tab('show')
743   })
744 </script>
745 {% endhighlight %}
746
747     <h3>Events</h3>
748     <div class="bs-table-scrollable">
749       <table class="table table-bordered table-striped">
750         <thead>
751          <tr>
752            <th style="width: 150px;">Event Type</th>
753            <th>Description</th>
754          </tr>
755         </thead>
756         <tbody>
757          <tr>
758            <td>show.bs.tab</td>
759            <td>This event fires on tab show, but before the new tab has been shown. Use <code>event.target</code> and <code>event.relatedTarget</code> to target the active tab and the previous active tab (if available) respectively.</td>
760         </tr>
761         <tr>
762            <td>shown.bs.tab</td>
763            <td>This event fires on tab show after a tab has been shown. Use <code>event.target</code> and <code>event.relatedTarget</code> to target the active tab and the previous active tab (if available) respectively.</td>
764          </tr>
765         </tbody>
766       </table>
767     </div><!-- /.bs-table-scrollable -->
768 {% highlight js %}
769 $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
770   e.target // activated tab
771   e.relatedTarget // previous tab
772 })
773 {% endhighlight %}
774   </div>
775
776
777
778   <!-- Tooltips
779   ================================================== -->
780   <div class="bs-docs-section">
781     <div class="page-header">
782       <h1 id="tooltips">Tooltips <small>tooltip.js</small></h1>
783     </div>
784
785     <h2 id="tooltips-examples">Examples</h2>
786     <p>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.</p>
787     <p>Hover over the links below to see tooltips:</p>
788     <div class="bs-example tooltip-demo">
789       <p class="muted" style="margin-bottom: 0;">Tight pants next level keffiyeh <a href="#" data-toggle="tooltip" title="Default tooltip">you probably</a> 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 <a href="#" data-toggle="tooltip" title="Another tooltip">have a</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 <a href="#" data-toggle="tooltip" title="Another one here too">whatever keytar</a>, scenester farm-to-table banksy Austin <a href="#" data-toggle="tooltip" title="The last tip!">twitter handle</a> freegan cred raw denim single-origin coffee viral.
790       </p>
791     </div><!-- /example -->
792
793     <h3>Four directions</h3>
794     <div class="bs-example tooltip-demo">
795       <div class="bs-example-tooltips">
796         <button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="left" title="Tooltip on left">Tooltip on left</button>
797         <button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="top" title="Tooltip on top">Tooltip on top</button>
798         <button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Tooltip on bottom">Tooltip on bottom</button>
799         <button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="right" title="Tooltip on right">Tooltip on right</button>
800       </div>
801     </div><!-- /example -->
802
803     <div class="bs-callout bs-callout-info">
804       <h4>Tooltips in button groups and input groups require special setting</h4>
805       <p>When using tooltips on elements within a <code>.btn-group</code> or an <code>.input-group</code>, you'll have to specify the option <code>container: 'body'</code> (documented below) to avoid unwanted side effects (such as the element growing wider and/or losing its rounded corners when the tooltip is triggered).</p>
806     </div>
807
808
809     <h2 id="tooltips-usage">Usage</h2>
810     <p>Trigger the tooltip via JavaScript:</p>
811 {% highlight js %}
812 $('#example').tooltip(options)
813 {% endhighlight %}
814
815     <h3>Options</h3>
816     <p>Options can be passed via data attributes or JavaScript. For data attributes, append the option name to <code>data-</code>, as in <code>data-animation=""</code>.</p>
817     <div class="bs-table-scrollable">
818       <table class="table table-bordered table-striped">
819         <thead>
820          <tr>
821            <th style="width: 100px;">Name</th>
822            <th style="width: 100px;">type</th>
823            <th style="width: 50px;">default</th>
824            <th>description</th>
825          </tr>
826         </thead>
827         <tbody>
828          <tr>
829            <td>animation</td>
830            <td>boolean</td>
831            <td>true</td>
832            <td>apply a CSS fade transition to the tooltip</td>
833          </tr>
834          <tr>
835            <td>html</td>
836            <td>boolean</td>
837            <td>false</td>
838            <td>Insert HTML into the tooltip. If false, jQuery's <code>text</code> method will be used to insert content into the DOM. Use text if you're worried about XSS attacks.</td>
839          </tr>
840          <tr>
841            <td>placement</td>
842            <td>string | function</td>
843            <td>'top'</td>
844            <td>how to position the tooltip - top | bottom | left | right | auto. <br> When "auto" is specified, it will dynamically reorient the tooltip. For example, if placement is "auto left", the tooltip will display to the left when possible, otherwise it will display right.</td>
845          </tr>
846          <tr>
847            <td>selector</td>
848            <td>string</td>
849            <td>false</td>
850            <td>If a selector is provided, tooltip objects will be delegated to the specified targets.</td>
851          </tr>
852          <tr>
853            <td>title</td>
854            <td>string | function</td>
855            <td>''</td>
856            <td>default title value if <code>title</code> attribute isn't present</td>
857          </tr>
858          <tr>
859            <td>trigger</td>
860            <td>string</td>
861            <td>'hover focus'</td>
862            <td>how tooltip is triggered - click | hover | focus | manual. You may pass multiple triggers; separate them with a space.</td>
863          </tr>
864          <tr>
865            <td>delay</td>
866            <td>number | object</td>
867            <td>0</td>
868            <td>
869             <p>delay showing and hiding the tooltip (ms) - does not apply to manual trigger type</p>
870             <p>If a number is supplied, delay is applied to both hide/show</p>
871             <p>Object structure is: <code>delay: { show: 500, hide: 100 }</code></p>
872            </td>
873          </tr>
874          <tr>
875            <td>container</td>
876            <td>string | false</td>
877            <td>false</td>
878            <td>
879             <p>Appends the tooltip to a specific element. Example: <code>container: 'body'</code></p>
880            </td>
881          </tr>
882         </tbody>
883       </table>
884     </div><!-- /.bs-table-scrollable -->
885     <div class="bs-callout bs-callout-info">
886       <h4>Data attributes for individual tooltips</h4>
887       <p>Options for individual tooltips can alternatively be specified through the use of data attributes, as explained above.</p>
888     </div>
889
890     <h3>Markup</h3>
891 {% highlight html %}
892 <a href="#" data-toggle="tooltip" title="first tooltip">Hover over me</a>
893 {% endhighlight %}
894
895     <h3>Methods</h3>
896
897     <h4>$().tooltip(options)</h4>
898     <p>Attaches a tooltip handler to an element collection.</p>
899
900     <h4>.tooltip('show')</h4>
901     <p>Reveals an element's tooltip.</p>
902     {% highlight js %}$('#element').tooltip('show'){% endhighlight %}
903
904     <h4>.tooltip('hide')</h4>
905     <p>Hides an element's tooltip.</p>
906     {% highlight js %}$('#element').tooltip('hide'){% endhighlight %}
907
908     <h4>.tooltip('toggle')</h4>
909     <p>Toggles an element's tooltip.</p>
910     {% highlight js %}$('#element').tooltip('toggle'){% endhighlight %}
911
912     <h4>.tooltip('destroy')</h4>
913     <p>Hides and destroys an element's tooltip.</p>
914     {% highlight js %}$('#element').tooltip('destroy'){% endhighlight %}
915
916     <h3>Events</h3>
917     <div class="bs-table-scrollable">
918       <table class="table table-bordered table-striped">
919         <thead>
920          <tr>
921            <th style="width: 150px;">Event Type</th>
922            <th>Description</th>
923          </tr>
924         </thead>
925         <tbody>
926          <tr>
927            <td>show.bs.tooltip</td>
928            <td>This event fires immediately when the <code>show</code> instance method is called.</td>
929          </tr>
930          <tr>
931            <td>shown.bs.tooltip</td>
932            <td>This event is fired when the tooltip has been made visible to the user (will wait for CSS transitions to complete).</td>
933          </tr>
934          <tr>
935            <td>hide.bs.tooltip</td>
936            <td>This event is fired immediately when the <code>hide</code> instance method has been called.</td>
937          </tr>
938          <tr>
939            <td>hidden.bs.tooltip</td>
940            <td>This event is fired when the tooltip has finished being hidden from the user (will wait for CSS transitions to complete).</td>
941          </tr>
942         </tbody>
943       </table>
944     </div><!-- /.bs-table-scrollable -->
945 {% highlight js %}
946 $('#myTooltip').on('hidden.bs.tooltip', function () {
947   // do something…
948 })
949 {% endhighlight %}
950   </div>
951
952   <!-- Popovers
953   ================================================== -->
954   <div class="bs-docs-section">
955     <div class="page-header">
956       <h1 id="popovers">Popovers <small>popover.js</small></h1>
957     </div>
958
959     <h2 id="popovers-examples">Examples</h2>
960     <p>Add small overlays of content, like those on the iPad, to any element for housing secondary information.</p>
961
962     <div class="bs-callout bs-callout-danger">
963       <h4>Plugin dependency</h4>
964       <p>Popovers require the <a href="#tooltips">tooltip plugin</a> to be included in your version of Bootstrap.</p>
965     </div>
966     <div class="bs-callout bs-callout-info">
967       <h4>Popovers in button groups and input groups require special setting</h4>
968       <p>When using popovers on elements within a <code>.btn-group</code> or an <code>.input-group</code>, you'll have to specify the option <code>container: 'body'</code> (documented below) to avoid unwanted side effects (such as the element growing wider and/or losing its rounded corners when the popover is triggered).</p>
969     </div>
970
971     <h3>Static popover</h3>
972     <p>Four options are available: top, right, bottom, and left aligned.</p>
973     <div class="bs-example bs-example-popover">
974       <div class="popover top">
975         <div class="arrow"></div>
976         <h3 class="popover-title">Popover top</h3>
977         <div class="popover-content">
978           <p>Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.</p>
979         </div>
980       </div>
981
982       <div class="popover right">
983         <div class="arrow"></div>
984         <h3 class="popover-title">Popover right</h3>
985         <div class="popover-content">
986           <p>Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.</p>
987         </div>
988       </div>
989
990       <div class="popover bottom">
991         <div class="arrow"></div>
992         <h3 class="popover-title">Popover bottom</h3>
993         <div class="popover-content">
994           <p>Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.</p>
995         </div>
996       </div>
997
998       <div class="popover left">
999         <div class="arrow"></div>
1000         <h3 class="popover-title">Popover left</h3>
1001         <div class="popover-content">
1002           <p>Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.</p>
1003         </div>
1004       </div>
1005
1006       <div class="clearfix"></div>
1007     </div>
1008
1009     <h3>Live demo</h3>
1010     <div class="bs-example" style="padding-bottom: 24px;">
1011       <a href="#" class="btn btn-lg btn-danger" data-toggle="popover" title="A Title" data-content="And here's some amazing content. It's very engaging. right?">Click to toggle popover</a>
1012     </div>
1013
1014     <h4>Four directions</h4>
1015     <div class="bs-example tooltip-demo">
1016       <div class="bs-example-tooltips">
1017         <button type="button" class="btn btn-default" data-container="body" data-toggle="popover" data-placement="left" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
1018           Popover on left
1019         </button>
1020         <button type="button" class="btn btn-default" data-container="body" data-toggle="popover" data-placement="top" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
1021           Popover on top
1022         </button>
1023         <button type="button" class="btn btn-default" data-container="body" data-toggle="popover" data-placement="bottom" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
1024           Popover on bottom
1025         </button>
1026         <button type="button" class="btn btn-default" data-container="body" data-toggle="popover" data-placement="right" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
1027           Popover on right
1028         </button>
1029       </div>
1030     </div><!-- /example -->
1031
1032
1033     <h2 id="popovers-usage">Usage</h2>
1034     <p>Enable popovers via JavaScript:</p>
1035     {% highlight js %}$('#example').popover(options){% endhighlight %}
1036
1037     <h3>Options</h3>
1038     <p>Options can be passed via data attributes or JavaScript. For data attributes, append the option name to <code>data-</code>, as in <code>data-animation=""</code>.</p>
1039     <div class="bs-table-scrollable">
1040       <table class="table table-bordered table-striped">
1041         <thead>
1042           <tr>
1043             <th style="width: 100px;">Name</th>
1044             <th style="width: 100px;">type</th>
1045             <th style="width: 50px;">default</th>
1046             <th>description</th>
1047           </tr>
1048         </thead>
1049         <tbody>
1050           <tr>
1051             <td>animation</td>
1052             <td>boolean</td>
1053             <td>true</td>
1054             <td>apply a CSS fade transition to the tooltip</td>
1055           </tr>
1056           <tr>
1057             <td>html</td>
1058             <td>boolean</td>
1059             <td>false</td>
1060             <td>Insert HTML into the popover. If false, jQuery's <code>text</code> method will be used to insert content into the DOM. Use text if you're worried about XSS attacks.</td>
1061           </tr>
1062           <tr>
1063             <td>placement</td>
1064             <td>string | function</td>
1065             <td>'right'</td>
1066             <td>how to position the popover - top | bottom | left | right | auto.<br> When "auto" is specified, it will dynamically reorient the popover. For example, if placement is "auto left", the tooltip will display to the left when possible, otherwise it will display right.</td>
1067           </tr>
1068           <tr>
1069             <td>selector</td>
1070             <td>string</td>
1071             <td>false</td>
1072             <td>if a selector is provided, tooltip objects will be delegated to the specified targets if a selector is provided, tooltip objects will be delegated to the specified targets. in practice, this is used to enable dynamic HTML content to have popovers added. See <a href="https://github.com/twbs/bootstrap/issues/4215">this</a> and <a href="http://jsfiddle.net/KPeKS/4/">an informative example</a>.</td>
1073           </tr>
1074           <tr>
1075             <td>trigger</td>
1076             <td>string</td>
1077             <td>'click'</td>
1078             <td>how popover is triggered - click | hover | focus | manual</td>
1079           </tr>
1080           <tr>
1081             <td>title</td>
1082             <td>string | function</td>
1083             <td>''</td>
1084             <td>default title value if <code>title</code> attribute isn't present</td>
1085           </tr>
1086           <tr>
1087             <td>content</td>
1088             <td>string | function</td>
1089             <td>''</td>
1090             <td>default content value if <code>data-content</code> attribute isn't present</td>
1091           </tr>
1092           <tr>
1093             <td>delay</td>
1094             <td>number | object</td>
1095             <td>0</td>
1096             <td>
1097              <p>delay showing and hiding the popover (ms) - does not apply to manual trigger type</p>
1098              <p>If a number is supplied, delay is applied to both hide/show</p>
1099              <p>Object structure is: <code>delay: { show: 500, hide: 100 }</code></p>
1100             </td>
1101           </tr>
1102           <tr>
1103             <td>container</td>
1104             <td>string | false</td>
1105             <td>false</td>
1106             <td>
1107              <p>Appends the popover to a specific element. Example: <code>container: 'body'</code></p>
1108             </td>
1109           </tr>
1110         </tbody>
1111       </table>
1112     </div><!-- /.bs-table-scrollable -->
1113     <div class="bs-callout bs-callout-info">
1114       <h4>Data attributes for individual popovers</h4>
1115       <p>Options for individual popovers can alternatively be specified through the use of data attributes, as explained above.</p>
1116     </div>
1117
1118     <h3>Markup</h3>
1119     <p>For performance reasons, the Tooltip and Popover data-apis are opt in. If you would like to use them just specify a selector option.</p>
1120
1121     <h3>Methods</h3>
1122     <h4>$().popover(options)</h4>
1123     <p>Initializes popovers for an element collection.</p>
1124
1125     <h4>.popover('show')</h4>
1126     <p>Reveals an elements popover.</p>
1127     {% highlight js %}$('#element').popover('show'){% endhighlight %}
1128
1129     <h4>.popover('hide')</h4>
1130     <p>Hides an elements popover.</p>
1131     {% highlight js %}$('#element').popover('hide'){% endhighlight %}
1132
1133     <h4>.popover('toggle')</h4>
1134     <p>Toggles an elements popover.</p>
1135     {% highlight js %}$('#element').popover('toggle'){% endhighlight %}
1136
1137     <h4>.popover('destroy')</h4>
1138     <p>Hides and destroys an element's popover.</p>
1139     {% highlight js %}$('#element').popover('destroy'){% endhighlight %}
1140     <h3>Events</h3>
1141     <div class="bs-table-scrollable">
1142       <table class="table table-bordered table-striped">
1143         <thead>
1144          <tr>
1145            <th style="width: 150px;">Event Type</th>
1146            <th>Description</th>
1147          </tr>
1148         </thead>
1149         <tbody>
1150          <tr>
1151            <td>show.bs.popover</td>
1152            <td>This event fires immediately when the <code>show</code> instance method is called.</td>
1153          </tr>
1154          <tr>
1155            <td>shown.bs.popover</td>
1156            <td>This event is fired when the popover has been made visible to the user (will wait for CSS transitions to complete).</td>
1157          </tr>
1158          <tr>
1159            <td>hide.bs.popover</td>
1160            <td>This event is fired immediately when the <code>hide</code> instance method has been called.</td>
1161          </tr>
1162          <tr>
1163            <td>hidden.bs.popover</td>
1164            <td>This event is fired when the popover has finished being hidden from the user (will wait for CSS transitions to complete).</td>
1165          </tr>
1166         </tbody>
1167       </table>
1168     </div><!-- /.bs-table-scrollable -->
1169 {% highlight js %}
1170 $('#myPopover').on('hidden.bs.popover', function () {
1171   // do something…
1172 })
1173 {% endhighlight %}
1174   </div>
1175
1176   <!-- Alert
1177   ================================================== -->
1178   <div class="bs-docs-section">
1179     <div class="page-header">
1180       <h1 id="alerts">Alert messages <small>alert.js</small></h1>
1181     </div>
1182
1183
1184     <h2 id="alerts-examples">Example alerts</h2>
1185     <p>Add dismiss functionality to all alert messages with this plugin.</p>
1186     <div class="bs-example">
1187       <div class="alert fade in">
1188         <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
1189         <strong>Holy guacamole!</strong> Best check yo self, you're not looking too good.
1190       </div>
1191     </div><!-- /example -->
1192
1193     <div class="bs-example">
1194       <div class="alert alert-block alert-danger fade in">
1195         <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
1196         <h4>Oh snap! You got an error!</h4>
1197         <p>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.</p>
1198         <p>
1199           <a class="btn btn-danger" href="#">Take this action</a> <a class="btn btn-default" href="#">Or do this</a>
1200         </p>
1201       </div>
1202     </div><!-- /example -->
1203
1204
1205     <h2 id="alerts-usage">Usage</h2>
1206     <p>Enable dismissal of an alert via JavaScript:</p>
1207     {% highlight js %}$(".alert").alert(){% endhighlight %}
1208
1209     <h3>Markup</h3>
1210     <p>Just add <code>data-dismiss="alert"</code> to your close button to automatically give an alert close functionality.</p>
1211     {% highlight html %}<a class="close" data-dismiss="alert" href="#" aria-hidden="true">&times;</a>{% endhighlight %}
1212
1213     <h3>Methods</h3>
1214
1215     <h4>$().alert()</h4>
1216     <p>Wraps all alerts with close functionality. To have your alerts animate out when closed, make sure they have the <code>.fade</code> and <code>.in</code> class already applied to them.</p>
1217
1218     <h4>.alert('close')</h4>
1219     <p>Closes an alert.</p>
1220     {% highlight js %}$(".alert").alert('close'){% endhighlight %}
1221
1222
1223     <h3>Events</h3>
1224     <p>Bootstrap's alert class exposes a few events for hooking into alert functionality.</p>
1225     <div class="bs-table-scrollable">
1226       <table class="table table-bordered table-striped">
1227         <thead>
1228           <tr>
1229             <th style="width: 150px;">Event Type</th>
1230             <th>Description</th>
1231           </tr>
1232         </thead>
1233         <tbody>
1234           <tr>
1235             <td>close.bs.alert</td>
1236             <td>This event fires immediately when the <code>close</code> instance method is called.</td>
1237           </tr>
1238           <tr>
1239             <td>closed.bs.alert</td>
1240             <td>This event is fired when the alert has been closed (will wait for CSS transitions to complete).</td>
1241           </tr>
1242         </tbody>
1243       </table>
1244     </div><!-- /.bs-table-scrollable -->
1245 {% highlight js %}
1246 $('#my-alert').bind('closed.bs.alert', function () {
1247   // do something…
1248 })
1249 {% endhighlight %}
1250   </div>
1251
1252
1253
1254   <!-- Buttons
1255   ================================================== -->
1256   <div class="bs-docs-section">
1257     <div class="page-header">
1258       <h1 id="buttons">Buttons <small>button.js</small></h1>
1259     </div>
1260
1261     <h2 id="buttons-examples">Example uses</h2>
1262     <p>Do more with buttons. Control button states or create groups of buttons for more components like toolbars.</p>
1263
1264     <h4>Stateful</h4>
1265     <p>Add <code>data-loading-text="Loading..."</code> to use a loading state on a button.</p>
1266     <div class="bs-example" style="padding-bottom: 24px;">
1267       <button type="button" id="fat-btn" data-loading-text="Loading..." class="btn btn-primary">
1268         Loading state
1269       </button>
1270     </div><!-- /example -->
1271 {% highlight html %}
1272 <button type="button" data-loading-text="Loading..." class="btn btn-primary">
1273   Loading state
1274 </button>
1275 {% endhighlight %}
1276
1277     <h4>Single toggle</h4>
1278     <p>Add <code>data-toggle="button"</code> to activate toggling on a single button.</p>
1279     <div class="bs-example" style="padding-bottom: 24px;">
1280       <button type="button" class="btn btn-primary" data-toggle="button">Single toggle</button>
1281     </div><!-- /example -->
1282 {% highlight html %}
1283 <button type="button" class="btn btn-primary" data-toggle="button">Single toggle</button>
1284 {% endhighlight %}
1285
1286     <h4>Checkbox</h4>
1287     <p>Add <code>data-toggle="buttons"</code> to a group of checkboxes for checkbox style toggling on btn-group.</p>
1288     <div class="bs-example" style="padding-bottom: 24px;">
1289       <div class="btn-group" data-toggle="buttons">
1290         <label class="btn btn-primary">
1291           <input type="checkbox"> Option 1
1292         </label>
1293         <label class="btn btn-primary">
1294           <input type="checkbox"> Option 2
1295         </label>
1296         <label class="btn btn-primary">
1297           <input type="checkbox"> Option 3
1298         </label>
1299       </div>
1300     </div><!-- /example -->
1301 {% highlight html %}
1302 <div class="btn-group" data-toggle="buttons">
1303   <label class="btn btn-primary">
1304     <input type="checkbox"> Option 1
1305   </label>
1306   <label class="btn btn-primary">
1307     <input type="checkbox"> Option 2
1308   </label>
1309   <label class="btn btn-primary">
1310     <input type="checkbox"> Option 3
1311   </label>
1312 </div>
1313 {% endhighlight %}
1314
1315     <h4>Radio</h4>
1316     <p>Add <code>data-toggle="buttons"</code> to a group of radio inputs for radio style toggling on btn-group.</p>
1317     <div class="bs-example" style="padding-bottom: 24px;">
1318       <div class="btn-group" data-toggle="buttons">
1319         <label class="btn btn-primary">
1320           <input type="radio" name="options" id="option1"> Option 1
1321         </label>
1322         <label class="btn btn-primary">
1323           <input type="radio" name="options" id="option2"> Option 2
1324         </label>
1325         <label class="btn btn-primary">
1326           <input type="radio" name="options" id="option3"> Option 3
1327         </label>
1328       </div>
1329     </div><!-- /example -->
1330 {% highlight html %}
1331 <div class="btn-group" data-toggle="buttons">
1332   <label class="btn btn-primary">
1333     <input type="radio" name="options" id="option1"> Option 1
1334   </label>
1335   <label class="btn btn-primary">
1336     <input type="radio" name="options" id="option2"> Option 2
1337   </label>
1338   <label class="btn btn-primary">
1339     <input type="radio" name="options" id="option3"> Option 3
1340   </label>
1341 </div>
1342 {% endhighlight %}
1343
1344
1345     <h2 id="buttons-usage">Usage</h2>
1346     <p>Enable buttons via JavaScript:</p>
1347 {% highlight js %}
1348 $('.nav-tabs').button()
1349 {% endhighlight %}
1350
1351     <h3>Markup</h3>
1352     <p>Data attributes are integral to the button plugin. Check out the example code below for the various markup types.</p>
1353
1354     <h3>Options</h3>
1355     <p><em>None</em></p>
1356
1357     <h3>Methods</h3>
1358
1359     <h4>$().button('toggle')</h4>
1360     <p>Toggles push state. Gives the button the appearance that it has been activated.</p>
1361     <div class="bs-callout bs-callout-info">
1362       <h4>Auto toggling</h4>
1363       <p>You can enable auto toggling of a button by using the <code>data-toggle</code> attribute.</p>
1364     </div>
1365 {% highlight html %}
1366 <button type="button" class="btn" data-toggle="button">...</button>
1367 {% endhighlight %}
1368
1369     <h4>$().button('loading')</h4>
1370     <p>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 <code>data-loading-text</code>.
1371     </p>
1372 {% highlight html %}
1373 <button type="button" class="btn" data-loading-text="loading stuff...">...</button>
1374 {% endhighlight %}
1375
1376     <div class="bs-callout bs-callout-danger">
1377       <h4>Cross-browser compatibility</h4>
1378       <p><a href="https://github.com/twbs/bootstrap/issues/793">Firefox persists the disabled state across page loads</a>. A workaround for this is to use <code>autocomplete="off"</code>.</p>
1379     </div>
1380
1381     <h4>$().button('reset')</h4>
1382     <p>Resets button state - swaps text to original text.</p>
1383
1384     <h4>$().button(string)</h4>
1385     <p>Resets button state - swaps text to any data defined text state.</p>
1386 {% highlight html %}
1387 <button type="button" class="btn" data-complete-text="finished!" >...</button>
1388 <script>
1389   $('.btn').button('complete')
1390 </script>
1391 {% endhighlight %}
1392   </div>
1393
1394
1395
1396   <!-- Collapse
1397   ================================================== -->
1398   <div class="bs-docs-section">
1399     <div class="page-header">
1400       <h1 id="collapse">Collapse <small>collapse.js</small></h1>
1401     </div>
1402
1403     <h3>About</h3>
1404     <p>Get base styles and flexible support for collapsible components like accordions and navigation.</p>
1405
1406     <div class="bs-callout bs-callout-danger">
1407       <h4>Plugin dependency</h4>
1408       <p>Collapse requires the <a href="#transitions">transitions plugin</a> to be included in your version of Bootstrap.</p>
1409     </div>
1410
1411     <h2 id="collapse-examples">Example accordion</h2>
1412     <p>Using the collapse plugin, we built a simple accordion by extending the panel component.</p>
1413
1414     <div class="bs-example">
1415       <div class="panel-group" id="accordion">
1416         <div class="panel">
1417           <div class="panel-heading">
1418             <h3 class="panel-title">
1419               <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#collapseOne">
1420                 Collapsible Group Item #1
1421               </a>
1422             </h3>
1423           </div>
1424           <div id="collapseOne" class="panel-collapse collapse in">
1425             <div class="panel-body">
1426               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.
1427             </div>
1428           </div>
1429         </div>
1430         <div class="panel">
1431           <div class="panel-heading">
1432             <h3 class="panel-title">
1433               <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo">
1434                 Collapsible Group Item #2
1435               </a>
1436             </h3>
1437           </div>
1438           <div id="collapseTwo" class="panel-collapse collapse">
1439             <div class="panel-body">
1440               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.
1441             </div>
1442           </div>
1443         </div>
1444         <div class="panel">
1445           <div class="panel-heading">
1446             <h3 class="panel-title">
1447               <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#collapseThree">
1448                 Collapsible Group Item #3
1449               </a>
1450             </h3>
1451           </div>
1452           <div id="collapseThree" class="panel-collapse collapse">
1453             <div class="panel-body">
1454               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.
1455             </div>
1456           </div>
1457         </div>
1458       </div>
1459     </div><!-- /example -->
1460 {% highlight html %}
1461 <div class="panel-group" id="accordion">
1462   <div class="panel">
1463     <div class="panel-heading">
1464       <h3 class="panel-title">
1465         <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#collapseOne">
1466           Collapsible Group Item #1
1467         </a>
1468       </h3>
1469     </div>
1470     <div id="collapseOne" class="panel-collapse collapse in">
1471       <div class="panel-body">
1472         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.
1473       </div>
1474     </div>
1475   </div>
1476   <div class="panel">
1477     <div class="panel-heading">
1478       <h3 class="panel-title">
1479         <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo">
1480           Collapsible Group Item #2
1481         </a>
1482       </h3>
1483     </div>
1484     <div id="collapseTwo" class="panel-collapse collapse">
1485       <div class="panel-body">
1486         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.
1487       </div>
1488     </div>
1489   </div>
1490   <div class="panel">
1491     <div class="panel-heading">
1492       <h3 class="panel-title">
1493         <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#collapseThree">
1494           Collapsible Group Item #3
1495         </a>
1496       </h3>
1497     </div>
1498     <div id="collapseThree" class="panel-collapse collapse">
1499       <div class="panel-body">
1500         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.
1501       </div>
1502     </div>
1503   </div>
1504 </div>
1505 {% endhighlight %}
1506
1507     <p>You can also use the plugin without the accordion markup. Make a button toggle the expanding and collapsing of another element.</p>
1508 {% highlight html %}
1509 <button type="button" class="btn btn-danger" data-toggle="collapse" data-target="#demo">
1510   simple collapsible
1511 </button>
1512
1513 <div id="demo" class="collapse in">...</div>
1514 {% endhighlight %}
1515
1516
1517     <h2 id="collapse-usage">Usage</h2>
1518
1519     <h3>Via data attributes</h3>
1520     <p>Just add <code>data-toggle="collapse"</code> and a <code>data-target</code> to element to automatically assign control of a collapsible element. The <code>data-target</code> attribute accepts a CSS selector to apply the collapse to. Be sure to add the class <code>collapse</code> to the collapsible element. If you'd like it to default open, add the additional class <code>in</code>.</p>
1521     <p>To add accordion-like group management to a collapsible control, add the data attribute <code>data-parent="#selector"</code>. Refer to the demo to see this in action.</p>
1522
1523     <h3>Via JavaScript</h3>
1524     <p>Enable manually with:</p>
1525 {% highlight js %}
1526 $(".collapse").collapse()
1527 {% endhighlight %}
1528
1529     <h3>Options</h3>
1530     <p>Options can be passed via data attributes or JavaScript. For data attributes, append the option name to <code>data-</code>, as in <code>data-parent=""</code>.</p>
1531     <div class="bs-table-scrollable">
1532       <table class="table table-bordered table-striped">
1533         <thead>
1534          <tr>
1535            <th style="width: 100px;">Name</th>
1536            <th style="width: 50px;">type</th>
1537            <th style="width: 50px;">default</th>
1538            <th>description</th>
1539          </tr>
1540         </thead>
1541         <tbody>
1542          <tr>
1543            <td>parent</td>
1544            <td>selector</td>
1545            <td>false</td>
1546            <td>If selector then all collapsible elements under the specified parent will be closed when this collapsible item is shown. (similar to traditional accordion behavior - this dependent on the <code>accordion-group</code> class)</td>
1547          </tr>
1548          <tr>
1549            <td>toggle</td>
1550            <td>boolean</td>
1551            <td>true</td>
1552            <td>Toggles the collapsible element on invocation</td>
1553          </tr>
1554         </tbody>
1555       </table>
1556     </div><!-- /.bs-table-scrollable -->
1557
1558     <h3>Methods</h3>
1559
1560     <h4>.collapse(options)</h4>
1561     <p>Activates your content as a collapsible element. Accepts an optional options <code>object</code>.
1562 {% highlight js %}
1563 $('#myCollapsible').collapse({
1564   toggle: false
1565 })
1566 {% endhighlight %}
1567
1568     <h4>.collapse('toggle')</h4>
1569     <p>Toggles a collapsible element to shown or hidden.</p>
1570
1571     <h4>.collapse('show')</h4>
1572     <p>Shows a collapsible element.</p>
1573
1574     <h4>.collapse('hide')</h4>
1575     <p>Hides a collapsible element.</p>
1576
1577     <h3>Events</h3>
1578     <p>Bootstrap's collapse class exposes a few events for hooking into collapse functionality.</p>
1579     <div class="bs-table-scrollable">
1580       <table class="table table-bordered table-striped">
1581         <thead>
1582          <tr>
1583            <th style="width: 150px;">Event Type</th>
1584            <th>Description</th>
1585          </tr>
1586         </thead>
1587         <tbody>
1588          <tr>
1589            <td>show.bs.collapse</td>
1590            <td>This event fires immediately when the <code>show</code> instance method is called.</td>
1591          </tr>
1592          <tr>
1593            <td>shown.bs.collapse</td>
1594            <td>This event is fired when a collapse element has been made visible to the user (will wait for CSS transitions to complete).</td>
1595          </tr>
1596          <tr>
1597            <td>hide.bs.collapse</td>
1598            <td>
1599             This event is fired immediately when the <code>hide</code> method has been called.
1600            </td>
1601          </tr>
1602          <tr>
1603            <td>hidden.bs.collapse</td>
1604            <td>This event is fired when a collapse element has been hidden from the user (will wait for CSS transitions to complete).</td>
1605          </tr>
1606         </tbody>
1607       </table>
1608     </div><!-- /.bs-table-scrollable -->
1609 {% highlight js %}
1610 $('#myCollapsible').on('hidden.bs.collapse', function () {
1611   // do something…
1612 })
1613 {% endhighlight %}
1614   </div>
1615
1616
1617
1618   <!-- Carousel
1619   ================================================== -->
1620   <div class="bs-docs-section">
1621     <div class="page-header">
1622       <h1 id="carousel">Carousel <small>carousel.js</small></h1>
1623     </div>
1624
1625     <h2 id="carousel-examples">Examples</h2>
1626     <p>The slideshow below shows a generic plugin and component for cycling through elements like a carousel.</p>
1627     <div class="bs-example">
1628       <div id="carousel-example-generic" class="carousel slide bs-docs-carousel-example">
1629         <ol class="carousel-indicators">
1630           <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
1631           <li data-target="#carousel-example-generic" data-slide-to="1"></li>
1632           <li data-target="#carousel-example-generic" data-slide-to="2"></li>
1633         </ol>
1634         <div class="carousel-inner">
1635           <div class="item active">
1636             <img src="data:image/png;base64," data-src="holder.js/900x500/auto/#777:#555/text:First slide" alt="First slide">
1637           </div>
1638           <div class="item">
1639             <img src="data:image/png;base64," data-src="holder.js/900x500/auto/#666:#444/text:Second slide" alt="Second slide">
1640           </div>
1641           <div class="item">
1642             <img src="data:image/png;base64," data-src="holder.js/900x500/auto/#555:#333/text:Third slide" alt="Third slide">
1643           </div>
1644         </div>
1645         <a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
1646           <span class="icon-prev"></span>
1647         </a>
1648         <a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
1649           <span class="icon-next"></span>
1650         </a>
1651       </div>
1652     </div><!-- /example -->
1653 {% highlight html %}
1654 <div id="carousel-example-generic" class="carousel slide">
1655   <!-- Indicators -->
1656   <ol class="carousel-indicators">
1657     <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
1658     <li data-target="#carousel-example-generic" data-slide-to="1"></li>
1659     <li data-target="#carousel-example-generic" data-slide-to="2"></li>
1660   </ol>
1661
1662   <!-- Wrapper for slides -->
1663   <div class="carousel-inner">
1664     <div class="item active">
1665       <img src="..." alt="...">
1666       <div class="carousel-caption">
1667         ...
1668       </div>
1669     </div>
1670     ...
1671   </div>
1672
1673   <!-- Controls -->
1674   <a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
1675     <span class="icon-prev"></span>
1676   </a>
1677   <a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
1678     <span class="icon-next"></span>
1679   </a>
1680 </div>
1681 {% endhighlight %}
1682 <div class="bs-callout bs-callout-info">
1683   <h4>Glyphicon Alternative</h4>
1684   <p>With <a href="{{ site.glyphicons }}">Glyphicons</a> available, you may choose to style the left and right toggle buttons with <code>.glyphicon .glyphicon-chevron-left</code> and <code>.glyphicon .glyphicon-chevron-right</code>.</p>
1685 </div>
1686
1687     <h3>Optional captions</h3>
1688     <p>Add captions to your slides easily with the <code>.carousel-caption</code> element within any <code>.item</code>. Place just about any optional HTML within there and it will be automatically aligned and formatted.</p>
1689     <div class="bs-example">
1690       <div id="carousel-example-captions" class="carousel slide bs-docs-carousel-example">
1691         <ol class="carousel-indicators">
1692           <li data-target="#carousel-example-captions" data-slide-to="0" class="active"></li>
1693           <li data-target="#carousel-example-captions" data-slide-to="1"></li>
1694           <li data-target="#carousel-example-captions" data-slide-to="2"></li>
1695         </ol>
1696         <div class="carousel-inner">
1697           <div class="item active">
1698             <img data-src="holder.js/900x500/auto/#777:#777" src="data:image/png;base64," alt="First slide image">
1699             <div class="carousel-caption">
1700               <h3>First slide label</h3>
1701               <p>Nulla vitae elit libero, a pharetra augue mollis interdum.</p>
1702             </div>
1703           </div>
1704           <div class="item">
1705             <img data-src="holder.js/900x500/auto/#666:#666" src="data:image/png;base64," alt="Second slide image">
1706             <div class="carousel-caption">
1707               <h3>Second slide label</h3>
1708               <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
1709             </div>
1710           </div>
1711           <div class="item">
1712             <img data-src="holder.js/900x500/auto/#555:#5555" src="data:image/png;base64," alt="Third slide image">
1713             <div class="carousel-caption">
1714               <h3>Third slide label</h3>
1715               <p>Praesent commodo cursus magna, vel scelerisque nisl consectetur.</p>
1716             </div>
1717           </div>
1718         </div>
1719         <a class="left carousel-control" href="#carousel-example-captions" data-slide="prev">
1720           <span class="icon-prev"></span>
1721         </a>
1722         <a class="right carousel-control" href="#carousel-example-captions" data-slide="next">
1723           <span class="icon-next"></span>
1724         </a>
1725       </div>
1726     </div><!-- /example -->
1727 {% highlight html %}
1728 <div class="item active">
1729   <img src="..." alt="...">
1730   <div class="carousel-caption">
1731     <h3>...</h3>
1732     <p>...</p>
1733   </div>
1734 </div>
1735 {% endhighlight %}
1736
1737 <div class="bs-callout bs-callout-danger">
1738   <h4>Accessibility issue</h4>
1739   <p>The carousel component is generally not compliant with accessibility standards. If you need to be compliant, please consider other options for presenting your content.</p>
1740 </div>
1741
1742     <h2 id="carousel-usage">Usage</h2>
1743
1744     <h3>Via data attributes</h3>
1745     <p>Use data attributes to easily control the position of the carousel. <code>data-slide</code> accepts the keywords <code>prev</code> or <code>next</code>, which alters the slide position relative to its current position. Alternatively, use <code>data-slide-to</code> to pass a raw slide index to the carousel <code>data-slide-to="2"</code>, which shifts the slide position to a particular index beginning with <code>0</code>.</p>
1746
1747     <h3>Via JavaScript</h3>
1748     <p>Call carousel manually with:</p>
1749 {% highlight js %}
1750 $('.carousel').carousel()
1751 {% endhighlight %}
1752
1753     <h3>Options</h3>
1754     <p>Options can be passed via data attributes or JavaScript. For data attributes, append the option name to <code>data-</code>, as in <code>data-interval=""</code>.</p>
1755     <div class="bs-table-scrollable">
1756       <table class="table table-bordered table-striped">
1757         <thead>
1758          <tr>
1759            <th style="width: 100px;">Name</th>
1760            <th style="width: 50px;">type</th>
1761            <th style="width: 50px;">default</th>
1762            <th>description</th>
1763          </tr>
1764         </thead>
1765         <tbody>
1766          <tr>
1767            <td>interval</td>
1768            <td>number</td>
1769            <td>5000</td>
1770            <td>The amount of time to delay between automatically cycling an item. If false, carousel will not automatically cycle.</td>
1771          </tr>
1772          <tr>
1773            <td>pause</td>
1774            <td>string</td>
1775            <td>"hover"</td>
1776            <td>Pauses the cycling of the carousel on mouseenter and resumes the cycling of the carousel on mouseleave.</td>
1777          </tr>
1778          <tr>
1779            <td>wrap</td>
1780            <td>boolean</td>
1781            <td>true</td>
1782            <td>Whether the carousel should cycle continuously or have hard stops.</td>
1783          </tr>
1784         </tbody>
1785       </table>
1786     </div><!-- /.bs-table-scrollable -->
1787
1788     <h3>Methods</h3>
1789
1790     <h4>.carousel(options)</h4>
1791     <p>Initializes the carousel with an optional options <code>object</code> and starts cycling through items.</p>
1792 {% highlight js %}
1793 $('.carousel').carousel({
1794   interval: 2000
1795 })
1796 {% endhighlight %}
1797
1798     <h4>.carousel('cycle')</h4>
1799     <p>Cycles through the carousel items from left to right.</p>
1800
1801     <h4>.carousel('pause')</h4>
1802     <p>Stops the carousel from cycling through items.</p>
1803
1804
1805     <h4>.carousel(number)</h4>
1806     <p>Cycles the carousel to a particular frame (0 based, similar to an array).</p>
1807
1808     <h4>.carousel('prev')</h4>
1809     <p>Cycles to the previous item.</p>
1810
1811     <h4>.carousel('next')</h4>
1812     <p>Cycles to the next item.</p>
1813
1814     <h3>Events</h3>
1815     <p>Bootstrap's carousel class exposes two events for hooking into carousel functionality.</p>
1816     <div class="bs-table-scrollable">
1817       <table class="table table-bordered table-striped">
1818         <thead>
1819          <tr>
1820            <th style="width: 150px;">Event Type</th>
1821            <th>Description</th>
1822          </tr>
1823         </thead>
1824         <tbody>
1825          <tr>
1826            <td>slide.bs.carousel</td>
1827            <td>This event fires immediately when the <code>slide</code> instance method is invoked.</td>
1828          </tr>
1829          <tr>
1830            <td>slid.bs.carousel</td>
1831            <td>This event is fired when the carousel has completed its slide transition.</td>
1832          </tr>
1833         </tbody>
1834       </table>
1835     </div><!-- /.bs-table-scrollable -->
1836 {% highlight js %}
1837 $('#myCarousel').on('slide.bs.carousel', function () {
1838   // do something…
1839 })
1840 {% endhighlight %}
1841   </div>
1842
1843
1844
1845   <!-- Affix
1846   ================================================== -->
1847   <div class="bs-docs-section">
1848     <div class="page-header">
1849       <h1 id="affix">Affix <small>affix.js</small></h1>
1850     </div>
1851
1852     <h2 id="affix-examples">Example</h2>
1853     <p>The subnavigation on the left is a live demo of the affix plugin.</p>
1854
1855     <hr class="bs-docs-separator">
1856
1857     <h2 id="affix-usage">Usage</h2>
1858
1859     <h3>Via data attributes</h3>
1860     <p>To easily add affix behavior to any element, just add <code>data-spy="affix"</code> to the element you want to spy on. Then use offsets to define when to toggle the pinning of an element on and off.</p>
1861
1862 {% highlight html %}
1863 <div data-spy="affix" data-offset-top="200">...</div>
1864 {% endhighlight %}
1865
1866     <div class="bs-callout bs-callout-warning">
1867       <h4>Requires independent styling ;)</h4>
1868       <p>
1869         Affix toggles between three states/classes: <code>affix</code>, <code>affix-top</code>, and <code>affix-bottom</code>. You must provide the styles for these classes yourself (independent of this plugin).
1870         The <code>affix-top</code> class should be in the regular flow of the document. The <code>affix</code> class should be fixed to the page. And <code>affix-bottom</code> should be positioned absolute. Note, <code>affix-bottom</code> is special in that the plugin will place the element with JS relative to the <code>offset: { bottom: number }</code> option you've provided.
1871       </p>
1872     </div>
1873
1874     <h3>Via JavaScript</h3>
1875     <p>Call the affix plugin via JavaScript:</p>
1876 {% highlight js %}
1877   $('#myAffix').affix({
1878     offset: {
1879       top: 100
1880     , bottom: function () {
1881         return (this.bottom = $('.bs-footer').outerHeight(true))
1882       }
1883     }
1884   })
1885 {% endhighlight %}
1886
1887
1888     <h3>Options</h3>
1889     <p>Options can be passed via data attributes or JavaScript. For data attributes, append the option name to <code>data-</code>, as in <code>data-offset-top="200"</code>.</p>
1890
1891     <div class="bs-table-scrollable">
1892       <table class="table table-bordered table-striped">
1893         <thead>
1894          <tr>
1895            <th style="width: 100px;">Name</th>
1896            <th style="width: 100px;">type</th>
1897            <th style="width: 50px;">default</th>
1898            <th>description</th>
1899          </tr>
1900         </thead>
1901         <tbody>
1902          <tr>
1903            <td>offset</td>
1904            <td>number | function | object</td>
1905            <td>10</td>
1906            <td>Pixels to offset from screen when calculating position of scroll. If a single number is provided, the offset will be applied in both top and left directions. To provide a unique, bottom and top offset just provide an object <code>offset: { top: 10 }</code> or <code>offset: { top: 10, bottom: 5 }</code>. Use a function when you need to dynamically calculate an offset.</td>
1907          </tr>
1908         </tbody>
1909       </table>
1910     </div><!-- /.bs-table-scrollable -->
1911
1912   </div>