javascript.mustache 76.4 KB
Newer Older
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
          <tbody>
           <tr>
             <td>{{_i}}close{{/i}}</td>
             <td>{{_i}}This event fires immediately when the <code>close</code> instance method is called.{{/i}}</td>
           </tr>
           <tr>
             <td>{{_i}}closed{{/i}}</td>
             <td>{{_i}}This event is fired when the alert has been closed (will wait for css transitions to complete).{{/i}}</td>
           </tr>
          </tbody>
        </table>
1012
1013
<pre class="prettyprint linenums">
$('#my-alert').bind('closed', function () {
1014
  // {{_i}}do something…{{/i}}
1015
1016
1017
})
</pre>
      </section>
1018
1019
1020



1021
1022
1023
1024
1025
1026
      <!-- Buttons
      ================================================== -->
      <section id="buttons">
        <div class="page-header">
          <h1>{{_i}}Buttons{{/i}} <small>bootstrap-button.js</small></h1>
        </div>
1027

1028
1029
        <h2>{{_i}}Example uses{{/i}}</h2>
        <p>{{_i}}Do more with buttons. Control button states or create groups of buttons for more components like toolbars.{{/i}}</p>
1030

1031
1032
1033
1034
1035
1036
1037
        <h4>{{_i}}Stateful{{/i}}</h4>
        <p>{{_i}}Add data-loading-text="Loading..." to use a loading state on a button.{{/i}}</p>
        <div class="bs-docs-example" style="padding-bottom: 24px;">
          <button type="button" id="fat-btn" data-loading-text="loading..." class="btn btn-primary">
            {{_i}}Loading state{{/i}}
          </button>
        </div>{{! /example }}
1038
<pre class="prettyprint linenums">
1039
&lt;button type="button" class="btn btn-primary" data-loading-text="Loading..."&gt;Loading state&lt;/button&gt;
1040
</pre>
1041

1042
1043
1044
1045
1046
        <h4>{{_i}}Single toggle{{/i}}</h4>
        <p>{{_i}}Add data-toggle="button" to activate toggling on a single button.{{/i}}</p>
        <div class="bs-docs-example" style="padding-bottom: 24px;">
          <button type="button" class="btn btn-primary" data-toggle="button">{{_i}}Single Toggle{{/i}}</button>
        </div>{{! /example }}
1047
<pre class="prettyprint linenums">
1048
&lt;button type="button" class="btn" data-toggle="button"&gt;Single Toggle&lt;/button&gt;
1049
</pre>
1050

1051
1052
1053
1054
1055
1056
1057
1058
1059
        <h4>{{_i}}Checkbox{{/i}}</h4>
        <p>{{_i}}Add data-toggle="buttons-checkbox" for checkbox style toggling on btn-group.{{/i}}</p>
        <div class="bs-docs-example" style="padding-bottom: 24px;">
          <div class="btn-group" data-toggle="buttons-checkbox">
            <button type="button" class="btn btn-primary">{{_i}}Left{{/i}}</button>
            <button type="button" class="btn btn-primary">{{_i}}Middle{{/i}}</button>
            <button type="button" class="btn btn-primary">{{_i}}Right{{/i}}</button>
          </div>
        </div>{{! /example }}
1060
1061
<pre class="prettyprint linenums">
&lt;div class="btn-group" data-toggle="buttons-checkbox"&gt;
1062
1063
1064
  &lt;button type="button" class="btn"&gt;Left&lt;/button&gt;
  &lt;button type="button" class="btn"&gt;Middle&lt;/button&gt;
  &lt;button type="button" class="btn"&gt;Right&lt;/button&gt;
1065
1066
&lt;/div&gt;
</pre>
1067

1068
1069
1070
1071
1072
1073
1074
1075
1076
        <h4>{{_i}}Radio{{/i}}</h4>
        <p>{{_i}}Add data-toggle="buttons-radio" for radio style toggling on btn-group.{{/i}}</p>
        <div class="bs-docs-example" style="padding-bottom: 24px;">
          <div class="btn-group" data-toggle="buttons-radio">
            <button type="button" class="btn btn-primary">{{_i}}Left{{/i}}</button>
            <button type="button" class="btn btn-primary">{{_i}}Middle{{/i}}</button>
            <button type="button" class="btn btn-primary">{{_i}}Right{{/i}}</button>
          </div>
        </div>{{! /example }}
1077
1078
<pre class="prettyprint linenums">
&lt;div class="btn-group" data-toggle="buttons-radio"&gt;
1079
1080
1081
  &lt;button type="button" class="btn"&gt;Left&lt;/button&gt;
  &lt;button type="button" class="btn"&gt;Middle&lt;/button&gt;
  &lt;button type="button" class="btn"&gt;Right&lt;/button&gt;
1082
1083
&lt;/div&gt;
</pre>
1084

1085

1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
        <hr class="bs-docs-separator">


        <h2>{{_i}}Usage{{/i}}</h2>
        <p>{{_i}}Enable buttons via javascript:{{/i}}</p>
        <pre class="prettyprint linenums">$('.nav-tabs').button()</pre>

        <h3>{{_i}}Markup{{/i}}</h3>
        <p>{{_i}}Data attributes are integral to the button plugin. Check out the example code below for the various markup types.{{/i}}</p>

        <h3>{{_i}}Options{{/i}}</h3>
        <p><em>{{_i}}None{{/i}}</em></p>

        <h3>{{_i}}Methods{{/i}}</h3>
        <h4>$().button('toggle')</h4>
        <p>{{_i}}Toggles push state. Gives the button the appearance that it has been activated.{{/i}}</p>
        <div class="alert alert-info">
          <strong>{{_i}}Heads up!{{/i}}</strong>
          {{_i}}You can enable auto toggling of a button by using the <code>data-toggle</code> attribute.{{/i}}
        </div>
        <pre class="prettyprint linenums">&lt;button type="button" class="btn" data-toggle="button" &gt;&lt;/button&gt;</pre>
        <h4>$().button('loading')</h4>
        <p>{{_i}}Sets button state to loading - disables button and swaps text to loading text. Loading text should be defined on the button element using the data attribute <code>data-loading-text</code>.{{/i}}
        </p>
        <pre class="prettyprint linenums">&lt;button type="button" class="btn" data-loading-text="loading stuff..." &gt;...&lt;/button&gt;</pre>
        <div class="alert alert-info">
          <strong>{{_i}}Heads up!{{/i}}</strong>
          {{_i}}<a href="https://github.com/twitter/bootstrap/issues/793">Firefox persists the disabled state across page loads</a>. A workaround for this is to use <code>autocomplete="off"</code>.{{/i}}
        </div>
        <h4>$().button('reset')</h4>
        <p>{{_i}}Resets button state - swaps text to original text.{{/i}}</p>
        <h4>$().button(string)</h4>
        <p>{{_i}}Resets button state - swaps text to any data defined text state.{{/i}}</p>
1119
<pre class="prettyprint linenums">&lt;button type="button" class="btn" data-complete-text="finished!" &gt;...&lt;/button&gt;
1120
&lt;script&gt;
Jacob Thornton's avatar
Jacob Thornton committed
1121
  $('.btn').button('complete')
1122
&lt;/script&gt;</pre>
1123
      </section>
1124
1125
1126



1127
1128
1129
1130
1131
1132
      <!-- Collapse
      ================================================== -->
      <section id="collapse">
        <div class="page-header">
          <h1>{{_i}}Collapse{{/i}} <small>bootstrap-collapse.js</small></h1>
        </div>
1133

1134
1135
1136
        <h3>{{_i}}About{{/i}}</h3>
        <p>{{_i}}Get base styles and flexible support for collapsible components like accordions and navigation.{{/i}}</p>
        <p class="muted"><strong>*</strong> {{_i}}Requires the Transitions plugin to be included.{{/i}}</p>
1137

1138
1139
        <h2>{{_i}}Example accordion{{/i}}</h2>
        <p>{{_i}}Using the collapse plugin, we built a simple accordion style widget:{{/i}}</p>
1140

1141
1142
1143
1144
1145
1146
1147
        <div class="bs-docs-example">
          <div class="accordion" id="accordion2">
            <div class="accordion-group">
              <div class="accordion-heading">
                <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
                  {{_i}}Collapsible Group Item #1{{/i}}
                </a>
1148
              </div>
1149
1150
1151
1152
              <div id="collapseOne" class="accordion-body collapse in">
                <div class="accordion-inner">
                  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.
                </div>
1153
1154
              </div>
            </div>
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
            <div class="accordion-group">
              <div class="accordion-heading">
                <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo">
                  {{_i}}Collapsible Group Item #2{{/i}}
                </a>
              </div>
              <div id="collapseTwo" class="accordion-body collapse">
                <div class="accordion-inner">
                  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.
                </div>
              </div>
1166
            </div>
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
            <div class="accordion-group">
              <div class="accordion-heading">
                <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseThree">
                  {{_i}}Collapsible Group Item #3{{/i}}
                </a>
              </div>
              <div id="collapseThree" class="accordion-body collapse">
                <div class="accordion-inner">
                  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.
                </div>
1177
1178
              </div>
            </div>
1179
          </div>
1180
        </div>{{! /example }}
1181
<pre class="prettyprint linenums">
1182
&lt;button type="button" class="btn btn-danger" data-toggle="collapse" data-target="#demo"&gt;
1183
1184
1185
1186
1187
  {{_i}}simple collapsible{{/i}}
&lt;/button&gt;

&lt;div id="demo" class="collapse in"&gt;&lt;/div&gt;
</pre>
1188

1189

1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
        <hr class="bs-docs-separator">


        <h2>{{_i}}Usage{{/i}}</h2>

        <h3>{{_i}}Via data attributes{{/i}}</h3>
        <p>{{_i}}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>.{{/i}}</p>
        <p>{{_i}}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.{{/i}}</p>

        <h3>{{_i}}Via javascript{{/i}}</h3>
        <p>{{_i}}Enable manually with:{{/i}}</p>
        <pre class="prettyprint linenums">$(".collapse").collapse()</pre>

        <h3>{{_i}}Options{{/i}}</h3>
        <p>{{_i}}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>.{{/i}}</p>
        <table class="table table-bordered table-striped">
          <thead>
           <tr>
             <th style="width: 100px;">{{_i}}Name{{/i}}</th>
             <th style="width: 50px;">{{_i}}type{{/i}}</th>
             <th style="width: 50px;">{{_i}}default{{/i}}</th>
             <th>{{_i}}description{{/i}}</th>
           </tr>
          </thead>
          <tbody>
           <tr>
             <td>{{_i}}parent{{/i}}</td>
             <td>{{_i}}selector{{/i}}</td>
             <td>false</td>
             <td>{{_i}}If selector then all collapsible elements under the specified parent will be closed when this collapsible item is shown. (similar to traditional accordion behavior){{/i}}</td>
           </tr>
           <tr>
             <td>{{_i}}toggle{{/i}}</td>
             <td>{{_i}}boolean{{/i}}</td>
             <td>true</td>
             <td>{{_i}}Toggles the collapsible element on invocation{{/i}}</td>
           </tr>
          </tbody>
        </table>


        <h3>{{_i}}Methods{{/i}}</h3>
        <h4>.collapse({{_i}}options{{/i}})</h4>
        <p>{{_i}}Activates your content as a collapsible element. Accepts an optional options <code>object</code>.{{/i}}
1234
1235
<pre class="prettyprint linenums">
$('#myCollapsible').collapse({
Jacob Thornton's avatar
Jacob Thornton committed
1236
  toggle: false
1237
})</pre>
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
        <h4>.collapse('toggle')</h4>
        <p>{{_i}}Toggles a collapsible element to shown or hidden.{{/i}}</p>
        <h4>.collapse('show')</h4>
        <p>{{_i}}Shows a collapsible element.{{/i}}</p>
        <h4>.collapse('hide')</h4>
        <p>{{_i}}Hides a collapsible element.{{/i}}</p>

        <h3>{{_i}}Events{{/i}}</h3>
        <p>{{_i}}Bootstrap's collapse class exposes a few events for hooking into collapse functionality.{{/i}}</p>
        <table class="table table-bordered table-striped">
          <thead>
           <tr>
             <th style="width: 150px;">{{_i}}Event{{/i}}</th>
             <th>{{_i}}Description{{/i}}</th>
           </tr>
          </thead>
          <tbody>
           <tr>
             <td>{{_i}}show{{/i}}</td>
             <td>{{_i}}This event fires immediately when the <code>show</code> instance method is called.{{/i}}</td>
           </tr>
           <tr>
             <td>{{_i}}shown{{/i}}</td>
             <td>{{_i}}This event is fired when a collapse element has been made visible to the user (will wait for css transitions to complete).{{/i}}</td>
           </tr>
           <tr>
             <td>{{_i}}hide{{/i}}</td>
             <td>
              {{_i}}This event is fired immediately when the <code>hide</code> method has been called.{{/i}}
             </td>
           </tr>
           <tr>
             <td>{{_i}}hidden{{/i}}</td>
             <td>{{_i}}This event is fired when a collapse element has been hidden from the user (will wait for css transitions to complete).{{/i}}</td>
           </tr>
          </tbody>
        </table>
1275
1276
<pre class="prettyprint linenums">
$('#myCollapsible').on('hidden', function () {
1277
  // {{_i}}do something…{{/i}}
1278
})</pre>
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
      </section>



       <!-- Carousel
      ================================================== -->
      <section id="carousel">
        <div class="page-header">
          <h1>{{_i}}Carousel{{/i}} <small>bootstrap-carousel.js</small></h1>
        </div>

        <h2>{{_i}}Example carousel{{/i}}</h2>
        <p>{{_i}}The slideshow below shows a generic plugin and component for cycling through elements like a carousel.{{/i}}</p>
        <div class="bs-docs-example">
          <div id="myCarousel" class="carousel slide">
            <div class="carousel-inner">
              <div class="item active">
                <img src="assets/img/bootstrap-mdo-sfmoma-01.jpg" alt="">
                <div class="carousel-caption">
                  <h4>{{_i}}First Thumbnail label{{/i}}</h4>
                  <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
                </div>
1301
              </div>
1302
1303
1304
1305
1306
1307
              <div class="item">
                <img src="assets/img/bootstrap-mdo-sfmoma-02.jpg" alt="">
                <div class="carousel-caption">
                  <h4>{{_i}}Second Thumbnail label{{/i}}</h4>
                  <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
                </div>
1308
              </div>
1309
1310
1311
1312
1313
1314
              <div class="item">
                <img src="assets/img/bootstrap-mdo-sfmoma-03.jpg" alt="">
                <div class="carousel-caption">
                  <h4>{{_i}}Third Thumbnail label{{/i}}</h4>
                  <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
                </div>
1315
1316
              </div>
            </div>
1317
1318
            <a class="left carousel-control" href="#myCarousel" data-slide="prev">&lsaquo;</a>
            <a class="right carousel-control" href="#myCarousel" data-slide="next">&rsaquo;</a>
1319
          </div>
1320
        </div>{{! /example }}
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
<pre class="prettyprint linenums">
&lt;div id="myCarousel" class="carousel slide"&gt;
  &lt;!-- {{_i}}Carousel items{{/i}} --&gt;
  &lt;div class="carousel-inner"&gt;
    &lt;div class="active item"&gt;&lt;/div&gt;
    &lt;div class="item"&gt;&lt;/div&gt;
    &lt;div class="item"&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;!-- {{_i}}Carousel nav{{/i}} --&gt;
  &lt;a class="carousel-control left" href="#myCarousel" data-slide="prev"&gt;&amp;lsaquo;&lt;/a&gt;
  &lt;a class="carousel-control right" href="#myCarousel" data-slide="next"&gt;&amp;rsaquo;&lt;/a&gt;
&lt;/div&gt;
</pre>
1334

1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
        <div class="alert alert-warning">
          <strong>{{_i}}Heads up!{{/i}}</strong>
          {{_i}}When implementing this carousel, remove the images we have provided and replace them with your own.{{/i}}
        </div>


        <hr class="bs-docs-separator">


        <h2>{{_i}}Usage{{/i}}</h2>

        <h3>{{_i}}Via data attributes{{/i}}</h3>
        <p>{{_i}}...{{/i}}</p>

        <h3>{{_i}}Via javascript{{/i}}</h3>
        <p>{{_i}}Call carousel manually with:{{/i}}</p>
        <pre class="prettyprint linenums">$('.carousel').carousel()</pre>

        <h3>{{_i}}Options{{/i}}</h3>
        <p>{{_i}}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>.{{/i}}</p>
        <table class="table table-bordered table-striped">
          <thead>
           <tr>
             <th style="width: 100px;">{{_i}}Name{{/i}}</th>
             <th style="width: 50px;">{{_i}}type{{/i}}</th>
             <th style="width: 50px;">{{_i}}default{{/i}}</th>
             <th>{{_i}}description{{/i}}</th>
           </tr>
          </thead>
          <tbody>
           <tr>
             <td>{{_i}}interval{{/i}}</td>
             <td>{{_i}}number{{/i}}</td>
             <td>5000</td>
             <td>{{_i}}The amount of time to delay between automatically cycling an item. If false, carousel will not automatically cycle.{{/i}}</td>
           </tr>
           <tr>
             <td>{{_i}}pause{{/i}}</td>
             <td>{{_i}}string{{/i}}</td>
             <td>"hover"</td>
             <td>{{_i}}Pauses the cycling of the carousel on mouseenter and resumes the cycling of the carousel on mouseleave.{{/i}}</td>
           </tr>
          </tbody>
        </table>

        <h3>{{_i}}Methods{{/i}}</h3>
        <h4>.carousel({{_i}}options{{/i}})</h4>
        <p>{{_i}}Initializes the carousel with an optional options <code>object</code> and starts cycling through items.{{/i}}</p>
1383
<pre class="prettyprint linenums">
1384
$('.carousel').carousel({
Jacob Thornton's avatar
Jacob Thornton committed
1385
  interval: 2000
1386
1387
})
</pre>
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
        <h4>.carousel('cycle')</h4>
        <p>{{_i}}Cycles through the carousel items from left to right.{{/i}}</p>
        <h4>.carousel('pause')</h4>
        <p>{{_i}}Stops the carousel from cycling through items.{{/i}}</p>
        <h4>.carousel(number)</h4>
        <p>{{_i}}Cycles the carousel to a particular frame (0 based, similar to an array).{{/i}}</p>
        <h4>.carousel('prev')</h4>
        <p>{{_i}}Cycles to the previous item.{{/i}}</p>
        <h4>.carousel('next')</h4>
        <p>{{_i}}Cycles to the next item.{{/i}}</p>

        <h3>{{_i}}Events{{/i}}</h3>
        <p>{{_i}}Bootstrap's carousel class exposes two events for hooking into carousel functionality.{{/i}}</p>
        <table class="table table-bordered table-striped">
          <thead>
           <tr>
             <th style="width: 150px;">{{_i}}Event{{/i}}</th>
             <th>{{_i}}Description{{/i}}</th>
           </tr>
          </thead>
          <tbody>
           <tr>
             <td>{{_i}}slide{{/i}}</td>
             <td>{{_i}}This event fires immediately when the <code>slide</code> instance method is invoked.{{/i}}</td>
           </tr>
           <tr>
             <td>{{_i}}slid{{/i}}</td>
             <td>{{_i}}This event is fired when the carousel has completed its slide transition.{{/i}}</td>
           </tr>
          </tbody>
        </table>
      </section>



      <!-- Typeahead
      ================================================== -->
      <section id="typeahead">
        <div class="page-header">
          <h1>{{_i}}Typeahead{{/i}} <small>bootstrap-typeahead.js</small></h1>
        </div>


        <h2>{{_i}}Example{{/i}}</h2>
        <p>{{_i}}A basic, easily extended plugin for quickly creating elegant typeaheads with any form text input.{{/i}}</p>
        <div class="bs-docs-example" style="background-color: #f5f5f5;">
          <input type="text" class="span3" style="margin: 0 auto;" data-provide="typeahead" data-items="4" data-source='["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Dakota","North Carolina","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"]'>
        </div>{{! /example }}
1436
1437
1438
<pre class="prettyprint linenums">
&lt;input type="text" data-provide="typeahead"&gt;
</pre>
1439

1440

1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
        <hr class="bs-docs-separator">


        <h2>{{_i}}Usage{{/i}}</h2>

        <h3>{{_i}}Via data attributes{{/i}}</h3>
        <p>{{_i}}Add data attributes to register an element with typeahead functionality as shown in the example above.{{/i}}</p>

        <h3>{{_i}}Via javascript{{/i}}</h3>
        <p>{{_i}}Call the typeahead manually with:{{/i}}</p>
        <pre class="prettyprint linenums">$('.typeahead').typeahead()</pre>

        <h3>{{_i}}Options{{/i}}</h3>
        <p>{{_i}}Options can be passed via data attributes or javascript. For data attributes, append the option name to <code>data-</code>, as in <code>data-source=""</code>.{{/i}}</p>
        <table class="table table-bordered table-striped">
          <thead>
           <tr>
             <th style="width: 100px;">{{_i}}Name{{/i}}</th>
             <th style="width: 50px;">{{_i}}type{{/i}}</th>
             <th style="width: 100px;">{{_i}}default{{/i}}</th>
             <th>{{_i}}description{{/i}}</th>
           </tr>
          </thead>
          <tbody>
            <tr>
             <td>{{_i}}source{{/i}}</td>
             <td>{{_i}}array, function{{/i}}</td>
             <td>[ ]</td>
             <td>{{_i}}The data source to query against. May be an array of strings or a function. The function is passed two arguments, the <code>query</code> value in the input field and the <code>process</code> callback. The function may be used synchronously by returning the data source directly or asynchronously via the <code>process</code> callback's single argument.{{/i}}</td>
           </tr>
           <tr>
             <td>{{_i}}items{{/i}}</td>
             <td>{{_i}}number{{/i}}</td>
             <td>8</td>
             <td>{{_i}}The max number of items to display in the dropdown.{{/i}}</td>
           </tr>
           <tr>
             <td>{{_i}}matcher{{/i}}</td>
             <td>{{_i}}function{{/i}}</td>
             <td>{{_i}}case insensitive{{/i}}</td>
             <td>{{_i}}The method used to determine if a query matches an item. Accepts a single argument, the <code>item</code> against which to test the query. Access the current query with <code>this.query</code>. Return a boolean <code>true</code> if query is a match.{{/i}}</td>
           </tr>
           <tr>
             <td>{{_i}}sorter{{/i}}</td>
             <td>{{_i}}function{{/i}}</td>
             <td>{{_i}}exact match,<br> case sensitive,<br> case insensitive{{/i}}</td>
             <td>{{_i}}Method used to sort autocomplete results. Accepts a single argument <code>items</code> and has the scope of the typeahead instance. Reference the current query with <code>this.query</code>.{{/i}}</td>
           </tr>
           <tr>
             <td>{{_i}}highlighter{{/i}}</td>
             <td>{{_i}}function{{/i}}</td>
             <td>{{_i}}highlights all default matches{{/i}}</td>
             <td>{{_i}}Method used to highlight autocomplete results. Accepts a single argument <code>item</code> and has the scope of the typeahead instance. Should return html.{{/i}}</td>
           </tr>
          </tbody>
        </table>

        <h3>{{_i}}Methods{{/i}}</h3>
        <h4>.typeahead({{_i}}options{{/i}})</h4>
        <p>{{_i}}Initializes an input with a typeahead.{{/i}}</p>
      </section>



      <!-- Affix
      ================================================== -->
      <section id="affix">
        <div class="page-header">
          <h1>
            {{_i}}Affix{{/i}}
            <small>{{_i}}Make an element stick in place{{/i}}</small>
          </h1>
        </div>
1514

1515
1516
1517
        <h2>{{_i}}...{{/i}}</h2>
        <p>{{_i}}...{{/i}}</p>
        <div class="bs-docs-example">
1518

1519
        </div>
1520
1521
1522
<pre class="prettyprint linenums">
...
</pre>
1523
1524
      </section>

1525
1526


1527
1528
    </div>{{! /span9 }}
  </div>{{! row}}
1529

1530
</div>{{! /container }}
For faster browsing, not all history is shown. View entire blame