unignore bower_components
[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.</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 transitionEnd 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 optional scrollbar</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-large">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-large">Launch demo modal</a>
197
198   <!-- Modal -->
199   <div class="modal" id="myModal">
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           <a href="#" class="btn">Close</a>
211           <a href="#" class="btn btn-primary">Save changes</a>
212         </div>
213       </div><!-- /.modal-content -->
214     </div><!-- /.modal-dialog -->
215   </div><!-- /.modal -->
216 {% endhighlight %}
217
218     <h2 id="modals-usage">Usage</h2>
219
220     <h3>Via data attributes</h3>
221     <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>
222 {% highlight html %}
223 <button type="button" data-toggle="modal" data-target="#myModal">Launch modal</button>
224 {% endhighlight %}
225
226     <h3>Via JavaScript</h3>
227     <p>Call a modal with id <code>myModal</code> with a single line of JavaScript:</p>
228     {% highlight js %}$('#myModal').modal(options){% endhighlight %}
229
230     <h3>Options</h3>
231     <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>
232     <div class="bs-table-scrollable">
233       <table class="table table-bordered table-striped">
234         <thead>
235          <tr>
236            <th style="width: 100px;">Name</th>
237            <th style="width: 50px;">type</th>
238            <th style="width: 50px;">default</th>
239            <th>description</th>
240          </tr>
241         </thead>
242         <tbody>
243          <tr>
244            <td>backdrop</td>
245            <td>boolean</td>
246            <td>true</td>
247            <td>Includes a modal-backdrop element. Alternatively, specify <code>static</code> for a backdrop which doesn't close the modal on click.</td>
248          </tr>
249          <tr>
250            <td>keyboard</td>
251            <td>boolean</td>
252            <td>true</td>
253            <td>Closes the modal when escape key is pressed</td>
254          </tr>
255          <tr>
256            <td>show</td>
257            <td>boolean</td>
258            <td>true</td>
259            <td>Shows the modal when initialized.</td>
260          </tr>
261          <tr>
262            <td>remote</td>
263            <td>path</td>
264            <td>false</td>
265            <td><p>If a remote URL is provided, content will be loaded via jQuery's <code>load</code> method and injected into the <code>.modal-body</code>. If you're using the data api, you may alternatively use the <code>href</code> tag to specify the remote source. An example of this is shown below:</p>
266 {% highlight html %}
267 <a data-toggle="modal" href="remote.html" data-target="#modal">Click me</a>
268 {% endhighlight %}
269          </tr>
270         </tbody>
271       </table>
272     </div><!-- /.bs-table-scrollable -->
273
274     <h3>Methods</h3>
275
276     <h4>.modal(options)</h4>
277     <p>Activates your content as a modal. Accepts an optional options <code>object</code>.</p>
278 {% highlight js %}
279 $('#myModal').modal({
280   keyboard: false
281 })
282 {% endhighlight %}
283
284     <h4>.modal('toggle')</h4>
285     <p>Manually toggles a modal.</p>
286     {% highlight js %}$('#myModal').modal('toggle'){% endhighlight %}
287
288     <h4>.modal('show')</h4>
289     <p>Manually opens a modal.</p>
290     {% highlight js %}$('#myModal').modal('show'){% endhighlight %}
291
292     <h4>.modal('hide')</h4>
293     <p>Manually hides a modal.</p>
294     {% highlight js %}$('#myModal').modal('hide'){% endhighlight %}
295
296     <h3>Events</h3>
297     <p>Bootstrap's modal class exposes a few events for hooking into modal functionality.</p>
298     <div class="bs-table-scrollable">
299       <table class="table table-bordered table-striped">
300         <thead>
301          <tr>
302            <th style="width: 150px;">Event Type</th>
303            <th>Description</th>
304          </tr>
305         </thead>
306         <tbody>
307          <tr>
308            <td>show</td>
309            <td>This event fires immediately when the <code>show</code> instance method is called.</td>
310          </tr>
311          <tr>
312            <td>shown</td>
313            <td>This event is fired when the modal has been made visible to the user (will wait for CSS transitions to complete).</td>
314          </tr>
315          <tr>
316            <td>hide</td>
317            <td>This event is fired immediately when the <code>hide</code> instance method has been called.</td>
318          </tr>
319          <tr>
320            <td>hidden</td>
321            <td>This event is fired when the modal has finished being hidden from the user (will wait for CSS transitions to complete).</td>
322          </tr>
323         </tbody>
324       </table>
325     </div><!-- /.bs-table-scrollable -->
326 {% highlight js %}
327 $('#myModal').on('hidden.bs.modal', function () {
328   // do something…
329 })
330 {% endhighlight %}
331   </div>
332
333
334
335   <!-- Dropdowns
336   ================================================== -->
337   <div class="bs-docs-section">
338     <div class="page-header">
339       <h1 id="dropdowns">Dropdowns <small>dropdown.js</small></h1>
340     </div>
341
342     <h2 id="dropdowns-examples">Examples</h2>
343     <p>Add dropdown menus to nearly anything with this simple plugin, including the navbar, tabs, and pills.</p>
344
345     <h3>Within a navbar</h3>
346     <div class="bs-example">
347       <div id="navbar-example" class="navbar navbar-static">
348         <div class="container" style="width: auto;">
349           <a class="navbar-brand" href="#">Project Name</a>
350           <button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".bs-js-navbar-collapse">
351             <span class="icon-bar"></span>
352             <span class="icon-bar"></span>
353             <span class="icon-bar"></span>
354           </button>
355           <div class="nav-collapse collapse bs-js-navbar-collapse">
356             <ul class="nav navbar-nav" role="navigation">
357               <li class="dropdown">
358                 <a id="drop1" href="#" role="button" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
359                 <ul class="dropdown-menu" role="menu" aria-labelledby="drop1">
360                   <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Action</a></li>
361                   <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Another action</a></li>
362                   <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Something else here</a></li>
363                   <li role="presentation" class="divider"></li>
364                   <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Separated link</a></li>
365                 </ul>
366               </li>
367               <li class="dropdown">
368                 <a href="#" id="drop2" role="button" class="dropdown-toggle" data-toggle="dropdown">Dropdown 2 <b class="caret"></b></a>
369                 <ul class="dropdown-menu" role="menu" aria-labelledby="drop2">
370                   <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Action</a></li>
371                   <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Another action</a></li>
372                   <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Something else here</a></li>
373                   <li role="presentation" class="divider"></li>
374                   <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Separated link</a></li>
375                 </ul>
376               </li>
377             </ul>
378             <ul class="nav navbar-nav pull-right">
379               <li id="fat-menu" class="dropdown">
380                 <a href="#" id="drop3" role="button" class="dropdown-toggle" data-toggle="dropdown">Dropdown 3 <b class="caret"></b></a>
381                 <ul class="dropdown-menu" role="menu" aria-labelledby="drop3">
382                   <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Action</a></li>
383                   <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Another action</a></li>
384                   <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Something else here</a></li>
385                   <li role="presentation" class="divider"></li>
386                   <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Separated link</a></li>
387                 </ul>
388               </li>
389             </ul>
390           </div><!-- /.nav-collapse -->
391         </div><!-- /.container -->
392       </div> <!-- /navbar-example -->
393     </div> <!-- /example -->
394
395     <h3>Within tabs</h3>
396     <div class="bs-example">
397       <ul class="nav nav-pills">
398         <li class="active"><a href="#">Regular link</a></li>
399         <li class="dropdown">
400           <a class="dropdown-toggle" id="drop4" role="button" data-toggle="dropdown" href="#">Dropdown <b class="caret"></b></a>
401           <ul id="menu1" class="dropdown-menu" role="menu" aria-labelledby="drop4">
402             <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Action</a></li>
403             <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Another action</a></li>
404             <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Something else here</a></li>
405             <li role="presentation" class="divider"></li>
406             <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Separated link</a></li>
407           </ul>
408         </li>
409         <li class="dropdown">
410           <a class="dropdown-toggle" id="drop5" role="button" data-toggle="dropdown" href="#">Dropdown 2 <b class="caret"></b></a>
411           <ul id="menu2" class="dropdown-menu" role="menu" aria-labelledby="drop5">
412             <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Action</a></li>
413             <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Another action</a></li>
414             <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Something else here</a></li>
415             <li role="presentation" class="divider"></li>
416             <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Separated link</a></li>
417           </ul>
418         </li>
419         <li class="dropdown">
420           <a class="dropdown-toggle" id="drop6" role="button" data-toggle="dropdown" href="#">Dropdown 3 <b class="caret"></b></a>
421           <ul id="menu3" class="dropdown-menu" role="menu" aria-labelledby="drop6">
422             <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Action</a></li>
423             <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Another action</a></li>
424             <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Something else here</a></li>
425             <li role="presentation" class="divider"></li>
426             <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Separated link</a></li>
427           </ul>
428         </li>
429       </ul> <!-- /tabs -->
430     </div> <!-- /example -->
431
432
433     <h2 id="dropdowns-usage">Usage</h2>
434
435     <h3>Via data attributes</h3>
436     <p>Add <code>data-toggle="dropdown"</code> to a link or button to toggle a dropdown.</p>
437 {% highlight html %}
438 <div class="dropdown">
439   <a class="dropdown-toggle" data-toggle="dropdown" href="#">Dropdown trigger</a>
440   <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
441     ...
442   </ul>
443 </div>
444 {% endhighlight %}
445           <p>To keep URLs intact, use the <code>data-target</code> attribute instead of <code>href="#"</code>.</p>
446 {% highlight html %}
447 <div class="dropdown">
448   <a class="dropdown-toggle" id="dLabel" role="button" data-toggle="dropdown" data-target="#" href="/page.html">
449     Dropdown <span class="caret"></span>
450   </a>
451   <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
452     ...
453   </ul>
454 </div>
455 {% endhighlight %}
456
457     <h3>Via JavaScript</h3>
458     <p>Call the dropdowns via JavaScript:</p>
459 {% highlight js %}
460 $('.dropdown-toggle').dropdown()
461 {% endhighlight %}
462
463     <h3>Options</h3>
464     <p><em>None</em></p>
465
466     <h3>Methods</h3>
467     <h4>$().dropdown('toggle')</h4>
468     <p>A programmatic api for toggling menus for a given navbar or tabbed navigation.</p>
469   </div>
470
471
472
473   <!-- ScrollSpy
474   ================================================== -->
475   <div class="bs-docs-section">
476     <div class="page-header">
477       <h1 id="scrollspy">ScrollSpy <small>scrollspy.js</small></h1>
478     </div>
479
480
481     <h2 id="scrollspy-examples">Example in navbar</h2>
482     <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>
483     <div class="bs-example">
484       <div id="navbar-example2" class="navbar navbar-static">
485         <div class="navbar-inner">
486           <div class="container" style="width: auto;">
487             <a class="navbar-brand" href="#">Project Name</a>
488             <ul class="nav navbar-nav">
489               <li><a href="#fat">@fat</a></li>
490               <li><a href="#mdo">@mdo</a></li>
491               <li class="dropdown">
492                 <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
493                 <ul class="dropdown-menu">
494                   <li><a href="#one">one</a></li>
495                   <li><a href="#two">two</a></li>
496                   <li class="divider"></li>
497                   <li><a href="#three">three</a></li>
498                 </ul>
499               </li>
500             </ul>
501           </div>
502         </div>
503       </div>
504       <div data-spy="scroll" data-target="#navbar-example2" data-offset="0" class="scrollspy-example">
505         <h4 id="fat">@fat</h4>
506         <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>
507         <h4 id="mdo">@mdo</h4>
508         <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>
509         <h4 id="one">one</h4>
510         <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>
511         <h4 id="two">two</h4>
512         <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>
513         <h4 id="three">three</h4>
514         <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>
515         <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.
516         </p>
517       </div>
518     </div><!-- /example -->
519
520
521     <h2 id="scrollspy-usage">Usage</h2>
522
523     <h3>Via data attributes</h3>
524     <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>
525 {% highlight html %}
526 <body data-spy="scroll" data-target="#navbar-example">
527   ...
528 </body>
529 {% endhighlight %}
530
531     <h3>Via JavaScript</h3>
532     <p>Call the scrollspy via JavaScript:</p>
533 {% highlight js %}
534 $('#navbar-example').scrollspy()
535 {% endhighlight %}
536
537     <div class="bs-callout bs-callout-danger">
538       <h4>Resolvable ID targets required</h4>
539       <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>
540     </div>
541
542     <h3>Methods</h3>
543     <h4>.scrollspy('refresh')</h4>
544     <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>
545 {% highlight js %}
546 $('[data-spy="scroll"]').each(function () {
547   var $spy = $(this).scrollspy('refresh')
548 });
549 {% endhighlight %}
550
551
552     <h3>Options</h3>
553     <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>
554     <div class="bs-table-scrollable">
555       <table class="table table-bordered table-striped">
556         <thead>
557          <tr>
558            <th style="width: 100px;">Name</th>
559            <th style="width: 100px;">type</th>
560            <th style="width: 50px;">default</th>
561            <th>description</th>
562          </tr>
563         </thead>
564         <tbody>
565          <tr>
566            <td>offset</td>
567            <td>number</td>
568            <td>10</td>
569            <td>Pixels to offset from top when calculating position of scroll.</td>
570          </tr>
571         </tbody>
572       </table>
573     </div><!-- ./bs-table-scrollable -->
574
575     <h3>Events</h3>
576     <div class="bs-table-scrollable">
577       <table class="table table-bordered table-striped">
578         <thead>
579          <tr>
580            <th style="width: 150px;">Event Type</th>
581            <th>Description</th>
582          </tr>
583         </thead>
584         <tbody>
585          <tr>
586            <td>activate</td>
587            <td>This event fires whenever a new item becomes activated by the scrollspy.</td>
588         </tr>
589         </tbody>
590       </table>
591     </div><!-- ./bs-table-scrollable -->
592 {% highlight js %}
593 $('#myScrollspy').on('activate.bs.scrollspy', function () {
594   // do something…
595 })
596 {% endhighlight %}
597   </div>
598
599
600
601   <!-- Tabs
602   ================================================== -->
603   <div class="bs-docs-section">
604     <div class="page-header">
605       <h1 id="tabs">Togglable tabs <small>tab.js</small></h1>
606     </div>
607
608     <h2 id="tabs-examples">Example tabs</h2>
609     <p>Add quick, dynamic tab functionality to transition through panes of local content, even via dropdown menus.</p>
610     <div class="bs-example bs-example-tabs">
611       <ul id="myTab" class="nav nav-tabs">
612         <li class="active"><a href="#home" data-toggle="tab">Home</a></li>
613         <li><a href="#profile" data-toggle="tab">Profile</a></li>
614         <li class="dropdown">
615           <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
616           <ul class="dropdown-menu">
617             <li><a href="#dropdown1" data-toggle="tab">@fat</a></li>
618             <li><a href="#dropdown2" data-toggle="tab">@mdo</a></li>
619           </ul>
620         </li>
621       </ul>
622       <div id="myTabContent" class="tab-content">
623         <div class="tab-pane fade in active" id="home">
624           <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>
625         </div>
626         <div class="tab-pane fade" id="profile">
627           <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>
628         </div>
629         <div class="tab-pane fade" id="dropdown1">
630           <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>
631         </div>
632         <div class="tab-pane fade" id="dropdown2">
633           <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>
634         </div>
635       </div>
636     </div><!-- /example -->
637
638
639     <h2 id="tabs-usage">Usage</h2>
640     <p>Enable tabbable tabs via JavaScript (each tab needs to be activated individually):</p>
641 {% highlight js %}
642 $('#myTab a').click(function (e) {
643   e.preventDefault();
644   $(this).tab('show');
645 })
646 {% endhighlight %}
647
648           <p>You can activate individual tabs in several ways:</p>
649 {% highlight js %}
650 $('#myTab a[href="#profile"]').tab('show'); // Select tab by name
651 $('#myTab a:first').tab('show'); // Select first tab
652 $('#myTab a:last').tab('show'); // Select last tab
653 $('#myTab li:eq(2) a').tab('show'); // Select third tab (0-indexed)
654 {% endhighlight %}
655
656     <h3>Markup</h3>
657     <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>
658 {% highlight html %}
659 <ul class="nav nav-tabs">
660   <li><a href="#home" data-toggle="tab">Home</a></li>
661   <li><a href="#profile" data-toggle="tab">Profile</a></li>
662   <li><a href="#messages" data-toggle="tab">Messages</a></li>
663   <li><a href="#settings" data-toggle="tab">Settings</a></li>
664 </ul>
665 {% endhighlight %}
666
667     <p>To make tabs fade in, add <code>.fade</code> to each <code>.tab-pane</code>.</p>
668
669     <h3>Methods</h3>
670     <h4>$().tab</h4>
671     <p>
672       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.
673     </p>
674 {% highlight html %}
675 <ul class="nav nav-tabs" id="myTab">
676   <li class="active"><a href="#home">Home</a></li>
677   <li><a href="#profile">Profile</a></li>
678   <li><a href="#messages">Messages</a></li>
679   <li><a href="#settings">Settings</a></li>
680 </ul>
681
682 <div class="tab-content">
683   <div class="tab-pane active" id="home">...</div>
684   <div class="tab-pane" id="profile">...</div>
685   <div class="tab-pane" id="messages">...</div>
686   <div class="tab-pane" id="settings">...</div>
687 </div>
688
689 <script>
690   $(function () {
691     $('#myTab a:last').tab('show');
692   })
693 </script>
694 {% endhighlight %}
695
696     <h3>Events</h3>
697     <div class="bs-table-scrollable">
698       <table class="table table-bordered table-striped">
699         <thead>
700          <tr>
701            <th style="width: 150px;">Event Type</th>
702            <th>Description</th>
703          </tr>
704         </thead>
705         <tbody>
706          <tr>
707            <td>show</td>
708            <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>
709         </tr>
710         <tr>
711            <td>shown</td>
712            <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>
713          </tr>
714         </tbody>
715       </table>
716     </div><!-- /.bs-table-scrollable -->
717 {% highlight js %}
718 $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
719   e.target // activated tab
720   e.relatedTarget // previous tab
721 })
722 {% endhighlight %}
723   </div>
724
725
726
727   <!-- Tooltips
728   ================================================== -->
729   <div class="bs-docs-section">
730     <div class="page-header">
731       <h1 id="tooltips">Tooltips <small>tooltip.js</small></h1>
732     </div>
733
734     <h2 id="tooltips-examples">Examples</h2>
735     <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>
736     <p>Hover over the links below to see tooltips:</p>
737     <div class="bs-example tooltip-demo">
738       <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.
739       </p>
740     </div><!-- /example -->
741
742     <h3>Four directions</h3>
743     <div class="bs-example tooltip-demo">
744       <div class="bs-example-tooltips">
745         <button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="top" title="Tooltip on top">Tooltip on top</button>
746         <button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="right" title="Tooltip on right">Tooltip on right</button>
747         <button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Tooltip on bottom">Tooltip on bottom</button>
748         <button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="left" title="Tooltip on left">Tooltip on left</button>
749       </div>
750     </div><!-- /example -->
751
752     <div class="bs-callout bs-callout-info">
753       <h4>Tooltips in button groups and input groups require special setting</h4>
754       <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>
755     </div>
756
757
758     <h2 id="tooltips-usage">Usage</h2>
759     <p>Trigger the tooltip via JavaScript:</p>
760 {% highlight js %}
761 $('#example').tooltip(options)
762 {% endhighlight %}
763
764     <h3>Options</h3>
765     <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>
766     <div class="bs-table-scrollable">
767       <table class="table table-bordered table-striped">
768         <thead>
769          <tr>
770            <th style="width: 100px;">Name</th>
771            <th style="width: 100px;">type</th>
772            <th style="width: 50px;">default</th>
773            <th>description</th>
774          </tr>
775         </thead>
776         <tbody>
777          <tr>
778            <td>animation</td>
779            <td>boolean</td>
780            <td>true</td>
781            <td>apply a CSS fade transition to the tooltip</td>
782          </tr>
783          <tr>
784            <td>html</td>
785            <td>boolean</td>
786            <td>false</td>
787            <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>
788          </tr>
789          <tr>
790            <td>placement</td>
791            <td>string | function</td>
792            <td>'top'</td>
793            <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 placment is "auto left", the tooltip will display to the left when possible, otherwise it will display right.</td>
794          </tr>
795          <tr>
796            <td>selector</td>
797            <td>string</td>
798            <td>false</td>
799            <td>If a selector is provided, tooltip objects will be delegated to the specified targets.</td>
800          </tr>
801          <tr>
802            <td>title</td>
803            <td>string | function</td>
804            <td>''</td>
805            <td>default title value if <code>title</code> tag isn't present</td>
806          </tr>
807          <tr>
808            <td>trigger</td>
809            <td>string</td>
810            <td>'hover focus'</td>
811            <td>how tooltip is triggered - click | hover | focus | manual. You may pass multiple triggers; separate them with a space.</td>
812          </tr>
813          <tr>
814            <td>delay</td>
815            <td>number | object</td>
816            <td>0</td>
817            <td>
818             <p>delay showing and hiding the tooltip (ms) - does not apply to manual trigger type</p>
819             <p>If a number is supplied, delay is applied to both hide/show</p>
820             <p>Object structure is: <code>delay: { show: 500, hide: 100 }</code></p>
821            </td>
822          </tr>
823          <tr>
824            <td>container</td>
825            <td>string | false</td>
826            <td>false</td>
827            <td>
828             <p>Appends the tooltip to a specific element. Example: <code>container: 'body'</code></p>
829            </td>
830          </tr>
831         </tbody>
832       </table>
833     </div><!-- /.bs-table-scrollable -->
834     <div class="bs-callout bs-callout-info">
835       <h4>Data attributes for individual tooltips</h4>
836       <p>Options for individual tooltips can alternatively be specified through the use of data attributes, as explained above.</p>
837     </div>
838
839     <h3>Markup</h3>
840 {% highlight html %}
841 <a href="#" data-toggle="tooltip" title="first tooltip">Hover over me</a>
842 {% endhighlight %}
843
844     <h3>Methods</h3>
845
846     <h4>$().tooltip(options)</h4>
847     <p>Attaches a tooltip handler to an element collection.</p>
848
849     <h4>.tooltip('show')</h4>
850     <p>Reveals an element's tooltip.</p>
851     {% highlight js %}$('#element').tooltip('show'){% endhighlight %}
852
853     <h4>.tooltip('hide')</h4>
854     <p>Hides an element's tooltip.</p>
855     {% highlight js %}$('#element').tooltip('hide'){% endhighlight %}
856
857     <h4>.tooltip('toggle')</h4>
858     <p>Toggles an element's tooltip.</p>
859     {% highlight js %}$('#element').tooltip('toggle'){% endhighlight %}
860
861     <h4>.tooltip('destroy')</h4>
862     <p>Hides and destroys an element's tooltip.</p>
863     {% highlight js %}$('#element').tooltip('destroy'){% endhighlight %}
864
865     <h3>Events</h3>
866     <div class="bs-table-scrollable">
867       <table class="table table-bordered table-striped">
868         <thead>
869          <tr>
870            <th style="width: 150px;">Event Type</th>
871            <th>Description</th>
872          </tr>
873         </thead>
874         <tbody>
875          <tr>
876            <td>show</td>
877            <td>This event fires immediately when the <code>show</code> instance method is called.</td>
878          </tr>
879          <tr>
880            <td>shown</td>
881            <td>This event is fired when the tooltip has been made visible to the user (will wait for CSS transitions to complete).</td>
882          </tr>
883          <tr>
884            <td>hide</td>
885            <td>This event is fired immediately when the <code>hide</code> instance method has been called.</td>
886          </tr>
887          <tr>
888            <td>hidden</td>
889            <td>This event is fired when the tooltip has finished being hidden from the user (will wait for CSS transitions to complete).</td>
890          </tr>
891         </tbody>
892       </table>
893     </div><!-- /.bs-table-scrollable -->
894 {% highlight js %}
895 $('#myTooltip').on('hidden.bs.tooltip', function () {
896 // do something…
897 })
898 {% endhighlight %}
899   </div>
900
901   <!-- Popovers
902   ================================================== -->
903   <div class="bs-docs-section">
904     <div class="page-header">
905       <h1 id="popovers">Popovers <small>popover.js</small></h1>
906     </div>
907
908     <h2 id="popovers-examples">Examples</h2>
909     <p>Add small overlays of content, like those on the iPad, to any element for housing secondary information.</p>
910
911     <div class="bs-callout bs-callout-danger">
912       <h4>Plugin dependency</h4>
913       <p>Popovers require the <a href="#tooltips">tooltip plugin</a> to be included in your version of Bootstrap.</p>
914     </div>
915     <div class="bs-callout bs-callout-info">
916       <h4>Popovers in button groups and input groups require special setting</h4>
917       <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>
918     </div>
919
920     <h3>Static popover</h3>
921     <p>Four options are available: top, right, bottom, and left aligned.</p>
922     <div class="bs-example bs-example-popover">
923       <div class="popover top">
924         <div class="arrow"></div>
925         <h3 class="popover-title">Popover top</h3>
926         <div class="popover-content">
927           <p>Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.</p>
928         </div>
929       </div>
930
931       <div class="popover right">
932         <div class="arrow"></div>
933         <h3 class="popover-title">Popover right</h3>
934         <div class="popover-content">
935           <p>Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.</p>
936         </div>
937       </div>
938
939       <div class="popover bottom">
940         <div class="arrow"></div>
941         <h3 class="popover-title">Popover bottom</h3>
942         <div class="popover-content">
943           <p>Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.</p>
944         </div>
945       </div>
946
947       <div class="popover left">
948         <div class="arrow"></div>
949         <h3 class="popover-title">Popover left</h3>
950         <div class="popover-content">
951           <p>Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.</p>
952         </div>
953       </div>
954
955       <div class="clearfix"></div>
956     </div>
957
958     <h3>Live demo</h3>
959     <div class="bs-example" style="padding-bottom: 24px;">
960       <a href="#" class="btn btn-large 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>
961     </div>
962
963     <h4>Four directions</h4>
964     <div class="bs-example tooltip-demo">
965       <div class="bs-example-tooltips">
966         <button type="button" class="btn btn-default" data-toggle="popover" data-placement="top" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
967           Popover on top
968         </button>
969         <button type="button" class="btn btn-default" data-toggle="popover" data-placement="right" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
970           Popover on right
971         </button>
972         <button type="button" class="btn btn-default" data-toggle="popover" data-placement="bottom" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
973           Popover on bottom
974         </button>
975         <button type="button" class="btn btn-default" data-toggle="popover" data-placement="left" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
976           Popover on left
977         </button>
978       </div>
979     </div><!-- /example -->
980
981
982     <h2 id="popovers-usage">Usage</h2>
983     <p>Enable popovers via JavaScript:</p>
984     {% highlight js %}$('#example').popover(options){% endhighlight %}
985
986     <h3>Options</h3>
987     <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>
988     <div class="bs-table-scrollable">
989       <table class="table table-bordered table-striped">
990         <thead>
991           <tr>
992             <th style="width: 100px;">Name</th>
993             <th style="width: 100px;">type</th>
994             <th style="width: 50px;">default</th>
995             <th>description</th>
996           </tr>
997         </thead>
998         <tbody>
999           <tr>
1000             <td>animation</td>
1001             <td>boolean</td>
1002             <td>true</td>
1003             <td>apply a CSS fade transition to the tooltip</td>
1004           </tr>
1005           <tr>
1006             <td>html</td>
1007             <td>boolean</td>
1008             <td>false</td>
1009             <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>
1010           </tr>
1011           <tr>
1012             <td>placement</td>
1013             <td>string | function</td>
1014             <td>'right'</td>
1015             <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 placment is "auto left", the tooltip will display to the left when possible, otherwise it will display right.</td>
1016           </tr>
1017           <tr>
1018             <td>selector</td>
1019             <td>string</td>
1020             <td>false</td>
1021             <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>
1022           </tr>
1023           <tr>
1024             <td>trigger</td>
1025             <td>string</td>
1026             <td>'click'</td>
1027             <td>how popover is triggered - click | hover | focus | manual</td>
1028           </tr>
1029           <tr>
1030             <td>title</td>
1031             <td>string | function</td>
1032             <td>''</td>
1033             <td>default title value if <code>title</code> attribute isn't present</td>
1034           </tr>
1035           <tr>
1036             <td>content</td>
1037             <td>string | function</td>
1038             <td>''</td>
1039             <td>default content value if <code>data-content</code> attribute isn't present</td>
1040           </tr>
1041           <tr>
1042             <td>delay</td>
1043             <td>number | object</td>
1044             <td>0</td>
1045             <td>
1046              <p>delay showing and hiding the popover (ms) - does not apply to manual trigger type</p>
1047              <p>If a number is supplied, delay is applied to both hide/show</p>
1048              <p>Object structure is: <code>delay: { show: 500, hide: 100 }</code></p>
1049             </td>
1050           </tr>
1051           <tr>
1052             <td>container</td>
1053             <td>string | false</td>
1054             <td>false</td>
1055             <td>
1056              <p>Appends the popover to a specific element. Example: <code>container: 'body'</code></p>
1057             </td>
1058           </tr>
1059         </tbody>
1060       </table>
1061     </div><!-- /.bs-table-scrollable -->
1062     <div class="bs-callout bs-callout-info">
1063       <h4>Data attributes for individual popovers</h4>
1064       <p>Options for individual popovers can alternatively be specified through the use of data attributes, as explained above.</p>
1065     </div>
1066
1067     <h3>Markup</h3>
1068     <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>
1069
1070     <h3>Methods</h3>
1071     <h4>$().popover(options)</h4>
1072     <p>Initializes popovers for an element collection.</p>
1073
1074     <h4>.popover('show')</h4>
1075     <p>Reveals an elements popover.</p>
1076     {% highlight js %}$('#element').popover('show'){% endhighlight %}
1077
1078     <h4>.popover('hide')</h4>
1079     <p>Hides an elements popover.</p>
1080     {% highlight js %}$('#element').popover('hide'){% endhighlight %}
1081
1082     <h4>.popover('toggle')</h4>
1083     <p>Toggles an elements popover.</p>
1084     {% highlight js %}$('#element').popover('toggle'){% endhighlight %}
1085
1086     <h4>.popover('destroy')</h4>
1087     <p>Hides and destroys an element's popover.</p>
1088     {% highlight js %}$('#element').popover('destroy'){% endhighlight %}
1089     <h3>Events</h3>
1090     <div class="bs-table-scrollable">
1091       <table class="table table-bordered table-striped">
1092         <thead>
1093          <tr>
1094            <th style="width: 150px;">Event Type</th>
1095            <th>Description</th>
1096          </tr>
1097         </thead>
1098         <tbody>
1099          <tr>
1100            <td>show</td>
1101            <td>This event fires immediately when the <code>show</code> instance method is called.</td>
1102          </tr>
1103          <tr>
1104            <td>shown</td>
1105            <td>This event is fired when the popover has been made visible to the user (will wait for CSS transitions to complete).</td>
1106          </tr>
1107          <tr>
1108            <td>hide</td>
1109            <td>This event is fired immediately when the <code>hide</code> instance method has been called.</td>
1110          </tr>
1111          <tr>
1112            <td>hidden</td>
1113            <td>This event is fired when the popover has finished being hidden from the user (will wait for CSS transitions to complete).</td>
1114          </tr>
1115         </tbody>
1116       </table>
1117     </div><!-- /.bs-table-scrollable -->
1118 {% highlight js %}
1119 $('#myPopover').on('hidden.bs.popover', function () {
1120   // do something…
1121 })
1122 {% endhighlight %}
1123   </div>
1124
1125   <!-- Alert
1126   ================================================== -->
1127   <div class="bs-docs-section">
1128     <div class="page-header">
1129       <h1 id="alerts">Alert messages <small>alert.js</small></h1>
1130     </div>
1131
1132
1133     <h2 id="alerts-examples">Example alerts</h2>
1134     <p>Add dismiss functionality to all alert messages with this plugin.</p>
1135     <div class="bs-example">
1136       <div class="alert fade in">
1137         <button type="button" class="close" data-dismiss="alert">&times;</button>
1138         <strong>Holy guacamole!</strong> Best check yo self, you're not looking too good.
1139       </div>
1140     </div><!-- /example -->
1141
1142     <div class="bs-example">
1143       <div class="alert alert-block alert-error fade in">
1144         <button type="button" class="close" data-dismiss="alert">&times;</button>
1145         <h4>Oh snap! You got an error!</h4>
1146         <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>
1147         <p>
1148           <a class="btn btn-danger" href="#">Take this action</a> <a class="btn btn-default" href="#">Or do this</a>
1149         </p>
1150       </div>
1151     </div><!-- /example -->
1152
1153
1154     <h2 id="alerts-usage">Usage</h2>
1155     <p>Enable dismissal of an alert via JavaScript:</p>
1156     {% highlight js %}$(".alert").alert(){% endhighlight %}
1157
1158     <h3>Markup</h3>
1159     <p>Just add <code>data-dismiss="alert"</code> to your close button to automatically give an alert close functionality.</p>
1160     {% highlight html %}<a class="close" data-dismiss="alert" href="#">&times;</a>{% endhighlight %}
1161
1162     <h3>Methods</h3>
1163
1164     <h4>$().alert()</h4>
1165     <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>
1166
1167     <h4>.alert('close')</h4>
1168     <p>Closes an alert.</p>
1169     {% highlight js %}$(".alert").alert('close'){% endhighlight %}
1170
1171
1172     <h3>Events</h3>
1173     <p>Bootstrap's alert class exposes a few events for hooking into alert functionality.</p>
1174     <div class="bs-table-scrollable">
1175       <table class="table table-bordered table-striped">
1176         <thead>
1177           <tr>
1178             <th style="width: 150px;">Event Type</th>
1179             <th>Description</th>
1180           </tr>
1181         </thead>
1182         <tbody>
1183           <tr>
1184             <td>close</td>
1185             <td>This event fires immediately when the <code>close</code> instance method is called.</td>
1186           </tr>
1187           <tr>
1188             <td>closed</td>
1189             <td>This event is fired when the alert has been closed (will wait for CSS transitions to complete).</td>
1190           </tr>
1191         </tbody>
1192       </table>
1193     </div><!-- /.bs-table-scrollable -->
1194 {% highlight js %}
1195 $('#my-alert').bind('closed.bs.alert', function () {
1196   // do something…
1197 })
1198 {% endhighlight %}
1199   </div>
1200
1201
1202
1203   <!-- Buttons
1204   ================================================== -->
1205   <div class="bs-docs-section">
1206     <div class="page-header">
1207       <h1 id="buttons">Buttons <small>button.js</small></h1>
1208     </div>
1209
1210     <h2 id="buttons-examples">Example uses</h2>
1211     <p>Do more with buttons. Control button states or create groups of buttons for more components like toolbars.</p>
1212
1213     <h4>Stateful</h4>
1214     <p>Add <code>data-loading-text="Loading..."</code> to use a loading state on a button.</p>
1215     <div class="bs-example" style="padding-bottom: 24px;">
1216       <button type="button" id="fat-btn" data-loading-text="Loading..." class="btn btn-primary">
1217         Loading state
1218       </button>
1219     </div><!-- /example -->
1220 {% highlight html %}
1221 <button type="button" id="fat-btn" data-loading-text="Loading..." class="btn btn-primary">
1222   Loading state
1223 </button>
1224 {% endhighlight %}
1225
1226     <h4>Single toggle</h4>
1227     <p>Add <code>data-toggle="button"</code> to activate toggling on a single button.</p>
1228     <div class="bs-example" style="padding-bottom: 24px;">
1229       <button type="button" class="btn btn-primary" data-toggle="button">Single toggle</button>
1230     </div><!-- /example -->
1231 {% highlight html %}
1232 <button type="button" class="btn btn-primary" data-toggle="button">Single toggle</button>
1233 {% endhighlight %}
1234
1235     <h4>Checkbox</h4>
1236     <p>Add <code>data-toggle="buttons"</code> to a group of checkboxes for checkbox style toggling on btn-group.</p>
1237     <div class="bs-example" style="padding-bottom: 24px;">
1238       <div class="btn-group" data-toggle="buttons">
1239         <label class="btn btn-primary">
1240           <input type="checkbox"> Option 1
1241         </label>
1242         <label class="btn btn-primary">
1243           <input type="checkbox"> Option 2
1244         </label>
1245         <label class="btn btn-primary">
1246           <input type="checkbox"> Option 3
1247         </label>
1248       </div>
1249     </div><!-- /example -->
1250 {% highlight html %}
1251 <div class="btn-group" data-toggle="buttons">
1252   <label class="btn btn-primary">
1253     <input type="checkbox"> Option 1
1254   </label>
1255   <label class="btn btn-primary">
1256     <input type="checkbox"> Option 2
1257   </label>
1258   <label class="btn btn-primary">
1259     <input type="checkbox"> Option 3
1260   </label>
1261 </div>
1262 {% endhighlight %}
1263
1264     <h4>Radio</h4>
1265     <p>Add <code>data-toggle="buttons"</code> to a group of radio inputs for radio style toggling on btn-group.</p>
1266     <div class="bs-example" style="padding-bottom: 24px;">
1267       <div class="btn-group" data-toggle="buttons">
1268         <label class="btn btn-primary">
1269           <input type="radio" name="options" id="option1"> Option 1
1270         </label>
1271         <label class="btn btn-primary">
1272           <input type="radio" name="options" id="option2"> Option 2
1273         </label>
1274         <label class="btn btn-primary">
1275           <input type="radio" name="options" id="option3"> Option 3
1276         </label>
1277       </div>
1278     </div><!-- /example -->
1279 {% highlight html %}
1280 <div class="btn-group" data-toggle="buttons">
1281   <label class="btn btn-primary">
1282     <input type="radio" name="options" id="option1"> Option 1
1283   </label>
1284   <label class="btn btn-primary">
1285     <input type="radio" name="options" id="option2"> Option 2
1286   </label>
1287   <label class="btn btn-primary">
1288     <input type="radio" name="options" id="option3"> Option 3
1289   </label>
1290 </div>
1291 {% endhighlight %}
1292
1293
1294     <h2 id="buttons-usage">Usage</h2>
1295     <p>Enable buttons via JavaScript:</p>
1296 {% highlight js %}
1297 $('.nav-tabs').button()
1298 {% endhighlight %}
1299
1300     <h3>Markup</h3>
1301     <p>Data attributes are integral to the button plugin. Check out the example code below for the various markup types.</p>
1302
1303     <h3>Options</h3>
1304     <p><em>None</em></p>
1305
1306     <h3>Methods</h3>
1307
1308     <h4>$().button('toggle')</h4>
1309     <p>Toggles push state. Gives the button the appearance that it has been activated.</p>
1310     <div class="bs-callout bs-callout-info">
1311       <h4>Auto toggling</h4>
1312       <p>You can enable auto toggling of a button by using the <code>data-toggle</code> attribute.</p>
1313     </div>
1314 {% highlight html %}
1315 <button type="button" class="btn" data-toggle="button">...</button>
1316 {% endhighlight %}
1317
1318     <h4>$().button('loading')</h4>
1319     <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>.
1320     </p>
1321 {% highlight html %}
1322 <button type="button" class="btn" data-loading-text="loading stuff...">...</button>
1323 {% endhighlight %}
1324
1325     <div class="bs-callout bs-callout-danger">
1326       <h4>Cross-browser compatibility</h4>
1327       <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>
1328     </div>
1329
1330     <h4>$().button('reset')</h4>
1331     <p>Resets button state - swaps text to original text.</p>
1332
1333     <h4>$().button(string)</h4>
1334     <p>Resets button state - swaps text to any data defined text state.</p>
1335 {% highlight html %}
1336 <button type="button" class="btn" data-complete-text="finished!" >...</button>
1337 <script>
1338   $('.btn').button('complete')
1339 </script>
1340 {% endhighlight %}
1341   </div>
1342
1343
1344
1345   <!-- Collapse
1346   ================================================== -->
1347   <div class="bs-docs-section">
1348     <div class="page-header">
1349       <h1 id="collapse">Collapse <small>collapse.js</small></h1>
1350     </div>
1351
1352     <h3>About</h3>
1353     <p>Get base styles and flexible support for collapsible components like accordions and navigation.</p>
1354
1355     <div class="bs-callout bs-callout-danger">
1356       <h4>Plugin dependency</h4>
1357       <p>Collapse requires the <a href="#transitions">transitions plugin</a> to be included in your version of Bootstrap.</p>
1358     </div>
1359
1360     <h2 id="collapse-examples">Example accordion</h2>
1361     <p>Using the collapse plugin, we built a simple accordion style widget:</p>
1362
1363     <div class="bs-example">
1364       <div class="accordion" id="accordion2">
1365         <div class="accordion-group">
1366           <div class="accordion-heading">
1367             <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
1368               Collapsible Group Item #1
1369             </a>
1370           </div>
1371           <div id="collapseOne" class="accordion-body collapse in">
1372             <div class="accordion-inner">
1373               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.
1374             </div>
1375           </div>
1376         </div>
1377         <div class="accordion-group">
1378           <div class="accordion-heading">
1379             <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo">
1380               Collapsible Group Item #2
1381             </a>
1382           </div>
1383           <div id="collapseTwo" class="accordion-body collapse">
1384             <div class="accordion-inner">
1385               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.
1386             </div>
1387           </div>
1388         </div>
1389         <div class="accordion-group">
1390           <div class="accordion-heading">
1391             <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseThree">
1392               Collapsible Group Item #3
1393             </a>
1394           </div>
1395           <div id="collapseThree" class="accordion-body collapse">
1396             <div class="accordion-inner">
1397               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.
1398             </div>
1399           </div>
1400         </div>
1401       </div>
1402     </div><!-- /example -->
1403 {% highlight html %}
1404 <div class="accordion" id="accordion2">
1405   <div class="accordion-group">
1406     <div class="accordion-heading">
1407       <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
1408         Collapsible Group Item #1
1409       </a>
1410     </div>
1411     <div id="collapseOne" class="accordion-body collapse in">
1412       <div class="accordion-inner">
1413         ...
1414       </div>
1415     </div>
1416   </div>
1417   <div class="accordion-group">
1418     <div class="accordion-heading">
1419       <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo">
1420         Collapsible Group Item #2
1421       </a>
1422     </div>
1423     <div id="collapseTwo" class="accordion-body collapse">
1424       <div class="accordion-inner">
1425         ...
1426       </div>
1427     </div>
1428   </div>
1429   <div class="accordion-group">
1430     <div class="accordion-heading">
1431       <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseThree">
1432         Collapsible Group Item #3
1433       </a>
1434     </div>
1435     <div id="collapseThree" class="accordion-body collapse">
1436       <div class="accordion-inner">
1437         ...
1438       </div>
1439     </div>
1440   </div>
1441 </div>
1442 {% endhighlight %}
1443
1444     <p>You can also use the plugin without the accordion markup. Make a button toggle the expanding and collapsing of another element.</p>
1445 {% highlight html %}
1446 <button type="button" class="btn btn-danger" data-toggle="collapse" data-target="#demo">
1447   simple collapsible
1448 </button>
1449
1450 <div id="demo" class="collapse in">...</div>
1451 {% endhighlight %}
1452
1453
1454     <h2 id="collapse-usage">Usage</h2>
1455
1456     <h3>Via data attributes</h3>
1457     <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>
1458     <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>
1459
1460     <h3>Via JavaScript</h3>
1461     <p>Enable manually with:</p>
1462 {% highlight js %}
1463 $(".collapse").collapse()
1464 {% endhighlight %}
1465
1466     <h3>Options</h3>
1467     <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>
1468     <div class="bs-table-scrollable">
1469       <table class="table table-bordered table-striped">
1470         <thead>
1471          <tr>
1472            <th style="width: 100px;">Name</th>
1473            <th style="width: 50px;">type</th>
1474            <th style="width: 50px;">default</th>
1475            <th>description</th>
1476          </tr>
1477         </thead>
1478         <tbody>
1479          <tr>
1480            <td>parent</td>
1481            <td>selector</td>
1482            <td>false</td>
1483            <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)</td>
1484          </tr>
1485          <tr>
1486            <td>toggle</td>
1487            <td>boolean</td>
1488            <td>true</td>
1489            <td>Toggles the collapsible element on invocation</td>
1490          </tr>
1491         </tbody>
1492       </table>
1493     </div><!-- /.bs-table-scrollable -->
1494
1495     <h3>Methods</h3>
1496
1497     <h4>.collapse(options)</h4>
1498     <p>Activates your content as a collapsible element. Accepts an optional options <code>object</code>.
1499 {% highlight js %}
1500 $('#myCollapsible').collapse({
1501   toggle: false
1502 })
1503 {% endhighlight %}
1504
1505     <h4>.collapse('toggle')</h4>
1506     <p>Toggles a collapsible element to shown or hidden.</p>
1507
1508     <h4>.collapse('show')</h4>
1509     <p>Shows a collapsible element.</p>
1510
1511     <h4>.collapse('hide')</h4>
1512     <p>Hides a collapsible element.</p>
1513
1514     <h3>Events</h3>
1515     <p>Bootstrap's collapse class exposes a few events for hooking into collapse functionality.</p>
1516     <div class="bs-table-scrollable">
1517       <table class="table table-bordered table-striped">
1518         <thead>
1519          <tr>
1520            <th style="width: 150px;">Event Type</th>
1521            <th>Description</th>
1522          </tr>
1523         </thead>
1524         <tbody>
1525          <tr>
1526            <td>show</td>
1527            <td>This event fires immediately when the <code>show</code> instance method is called.</td>
1528          </tr>
1529          <tr>
1530            <td>shown</td>
1531            <td>This event is fired when a collapse element has been made visible to the user (will wait for CSS transitions to complete).</td>
1532          </tr>
1533          <tr>
1534            <td>hide</td>
1535            <td>
1536             This event is fired immediately when the <code>hide</code> method has been called.
1537            </td>
1538          </tr>
1539          <tr>
1540            <td>hidden</td>
1541            <td>This event is fired when a collapse element has been hidden from the user (will wait for CSS transitions to complete).</td>
1542          </tr>
1543         </tbody>
1544       </table>
1545     </div><!-- /.bs-table-scrollable -->
1546 {% highlight js %}
1547 $('#myCollapsible').on('hidden.bs.collapse', function () {
1548   // do something…
1549 })
1550 {% endhighlight %}
1551   </div>
1552
1553
1554
1555   <!-- Carousel
1556   ================================================== -->
1557   <div class="bs-docs-section">
1558     <div class="page-header">
1559       <h1 id="carousel">Carousel <small>carousel.js</small></h1>
1560     </div>
1561
1562     <h2 id="carousel-examples">Examples</h2>
1563     <p>The slideshow below shows a generic plugin and component for cycling through elements like a carousel.</p>
1564     <div class="bs-example">
1565       <div id="carousel-example-generic" class="carousel slide bs-docs-carousel-example">
1566         <ol class="carousel-indicators">
1567           <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
1568           <li data-target="#carousel-example-generic" data-slide-to="1"></li>
1569           <li data-target="#carousel-example-generic" data-slide-to="2"></li>
1570         </ol>
1571         <div class="carousel-inner">
1572           <div class="item active">
1573             <img data-src="holder.js/900x500/auto/#777:#555/text:First slide" alt="">
1574           </div>
1575           <div class="item">
1576             <img data-src="holder.js/900x500/auto/#666:#444/text:Second slide" alt="">
1577           </div>
1578           <div class="item">
1579             <img data-src="holder.js/900x500/auto/#555:#333/text:Third slide" alt="">
1580           </div>
1581         </div>
1582         <a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
1583           <span class="icon-prev"></span>
1584         </a>
1585         <a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
1586           <span class="icon-next"></span>
1587         </a>
1588       </div>
1589     </div><!-- /example -->
1590 {% highlight html %}
1591 <div id="carousel-example-generic" class="carousel slide">
1592   <!-- Indicators -->
1593   <ol class="carousel-indicators">
1594     <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
1595     <li data-target="#carousel-example-generic" data-slide-to="1"></li>
1596     <li data-target="#carousel-example-generic" data-slide-to="2"></li>
1597   </ol>
1598
1599   <!-- Wrapper for slides -->
1600   <div class="carousel-inner">
1601     <div class="item active">
1602       <img src="..." alt="">
1603       <div class="carousel-caption">
1604         ...
1605       </div>
1606     </div>
1607     ...
1608   </div>
1609
1610   <!-- Controls -->
1611   <a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
1612     <span class="icon-prev"></span>
1613   </a>
1614   <a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
1615     <span class="icon-next"></span>
1616   </a>
1617 </div>
1618 {% endhighlight %}
1619 <div class="bs-callout bs-callout-info">
1620   <h4>Glyphicon Alternative</h4>
1621   <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>
1622 </div>
1623
1624     <h3>Optional captions</h3>
1625     <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>
1626     <div class="bs-example">
1627       <div id="carousel-example-captions" class="carousel slide bs-docs-carousel-example">
1628         <ol class="carousel-indicators">
1629           <li data-target="#carousel-example-captions" data-slide-to="0" class="active"></li>
1630           <li data-target="#carousel-example-captions" data-slide-to="1"></li>
1631           <li data-target="#carousel-example-captions" data-slide-to="2"></li>
1632         </ol>
1633         <div class="carousel-inner">
1634           <div class="item active">
1635             <img data-src="holder.js/900x500/auto/#777:#777" alt="">
1636             <div class="carousel-caption">
1637               <h3>First slide label</h3>
1638               <p>Nulla vitae elit libero, a pharetra augue mollis interdum.</p>
1639             </div>
1640           </div>
1641           <div class="item">
1642             <img data-src="holder.js/900x500/auto/#666:#666" alt="">
1643             <div class="carousel-caption">
1644               <h3>Second slide label</h3>
1645               <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
1646             </div>
1647           </div>
1648           <div class="item">
1649             <img data-src="holder.js/900x500/auto/#555:#5555" alt="">
1650             <div class="carousel-caption">
1651               <h3>Third slide label</h3>
1652               <p>Praesent commodo cursus magna, vel scelerisque nisl consectetur.</p>
1653             </div>
1654           </div>
1655         </div>
1656         <a class="left carousel-control" href="#carousel-example-captions" data-slide="prev">
1657           <span class="icon-prev"></span>
1658         </a>
1659         <a class="right carousel-control" href="#carousel-example-captions" data-slide="next">
1660           <span class="icon-next"></span>
1661         </a>
1662       </div>
1663     </div><!-- /example -->
1664 {% highlight html %}
1665 <div class="item active">
1666   <img src="..." alt="">
1667   <div class="carousel-caption">
1668     <h3>...</h3>
1669     <p>...</p>
1670   </div>
1671 </div>
1672 {% endhighlight %}
1673
1674
1675     <h2 id="carousel-usage">Usage</h2>
1676
1677     <h3>Via data attributes</h3>
1678     <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>
1679
1680     <h3>Via JavaScript</h3>
1681     <p>Call carousel manually with:</p>
1682 {% highlight js %}
1683 $('.carousel').carousel()
1684 {% endhighlight %}
1685
1686     <h3>Options</h3>
1687     <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>
1688     <div class="bs-table-scrollable">
1689       <table class="table table-bordered table-striped">
1690         <thead>
1691          <tr>
1692            <th style="width: 100px;">Name</th>
1693            <th style="width: 50px;">type</th>
1694            <th style="width: 50px;">default</th>
1695            <th>description</th>
1696          </tr>
1697         </thead>
1698         <tbody>
1699          <tr>
1700            <td>interval</td>
1701            <td>number</td>
1702            <td>5000</td>
1703            <td>The amount of time to delay between automatically cycling an item. If false, carousel will not automatically cycle.</td>
1704          </tr>
1705          <tr>
1706            <td>pause</td>
1707            <td>string</td>
1708            <td>"hover"</td>
1709            <td>Pauses the cycling of the carousel on mouseenter and resumes the cycling of the carousel on mouseleave.</td>
1710          </tr>
1711         </tbody>
1712       </table>
1713     </div><!-- /.bs-table-scrollable -->
1714
1715     <h3>Methods</h3>
1716
1717     <h4>.carousel(options)</h4>
1718     <p>Initializes the carousel with an optional options <code>object</code> and starts cycling through items.</p>
1719 {% highlight html %}
1720 $('.carousel').carousel({
1721   interval: 2000
1722 })
1723 {% endhighlight %}
1724
1725     <h4>.carousel('cycle')</h4>
1726     <p>Cycles through the carousel items from left to right.</p>
1727
1728     <h4>.carousel('pause')</h4>
1729     <p>Stops the carousel from cycling through items.</p>
1730
1731
1732     <h4>.carousel(number)</h4>
1733     <p>Cycles the carousel to a particular frame (0 based, similar to an array).</p>
1734
1735     <h4>.carousel('prev')</h4>
1736     <p>Cycles to the previous item.</p>
1737
1738     <h4>.carousel('next')</h4>
1739     <p>Cycles to the next item.</p>
1740
1741     <h3>Events</h3>
1742     <p>Bootstrap's carousel class exposes two events for hooking into carousel functionality.</p>
1743     <div class="bs-table-scrollable">
1744       <table class="table table-bordered table-striped">
1745         <thead>
1746          <tr>
1747            <th style="width: 150px;">Event Type</th>
1748            <th>Description</th>
1749          </tr>
1750         </thead>
1751         <tbody>
1752          <tr>
1753            <td>slide</td>
1754            <td>This event fires immediately when the <code>slide</code> instance method is invoked.</td>
1755          </tr>
1756          <tr>
1757            <td>slid</td>
1758            <td>This event is fired when the carousel has completed its slide transition.</td>
1759          </tr>
1760         </tbody>
1761       </table>
1762     </div><!-- /.bs-table-scrollable -->
1763 {% highlight js %}
1764 $('#myCarousel').on('slide.bs.carousel', function () {
1765   // do something…
1766 })
1767 {% endhighlight %}
1768   </div>
1769
1770
1771
1772   <!-- Affix
1773   ================================================== -->
1774   <div class="bs-docs-section">
1775     <div class="page-header">
1776       <h1 id="affix">Affix <small>affix.js</small></h1>
1777     </div>
1778
1779     <h2 id="affix-examples">Example</h2>
1780     <p>The subnavigation on the left is a live demo of the affix plugin.</p>
1781
1782     <hr class="bs-docs-separator">
1783
1784     <h2 id="affix-usage">Usage</h2>
1785
1786     <h3>Via data attributes</h3>
1787     <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>
1788
1789 {% highlight html %}
1790 <div data-spy="affix" data-offset-top="200">...</div>
1791 {% endhighlight %}
1792
1793     <div class="bs-callout bs-callout-warning">
1794       <h4>Requires independent styling ;)</h4>
1795       <p>
1796         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).
1797         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.
1798       </p>
1799     </div>
1800
1801     <h3>Via JavaScript</h3>
1802     <p>Call the affix plugin via JavaScript:</p>
1803 {% highlight js %}
1804   $('#myAffix').affix({
1805     offset: {
1806       top: 100
1807     , bottom: function () {
1808         return (this.bottom = $('.bs-footer').outerHeight(true))
1809       }
1810     }
1811   })
1812 {% endhighlight %}
1813
1814
1815     <h3>Options</h3>
1816     <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>
1817
1818     <div class="bs-table-scrollable">
1819       <table class="table table-bordered table-striped">
1820         <thead>
1821          <tr>
1822            <th style="width: 100px;">Name</th>
1823            <th style="width: 100px;">type</th>
1824            <th style="width: 50px;">default</th>
1825            <th>description</th>
1826          </tr>
1827         </thead>
1828         <tbody>
1829          <tr>
1830            <td>offset</td>
1831            <td>number | function | object</td>
1832            <td>10</td>
1833            <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>
1834          </tr>
1835         </tbody>
1836       </table>
1837     </div><!-- /.bs-table-scrollable -->
1838
1839   </div>