javascript.mustache 70.67 KiB
      <!-- Masthead
      ================================================== -->
      <header class="jumbotron subhead" id="overview">
        <h1>{{_i}}Javascript for Bootstrap{{/i}}</h1>
        <p class="lead">{{_i}}Bring Bootstrap's components to life&mdash;now with 12 custom <a href="http://jquery.com/" target="_blank">jQuery</a> plugins.{{/i}}
        <div class="subnav">
          <ul class="nav nav-pills">
            <li><a href="#javascript">{{_i}}All plugins{{/i}}</a></li>
            <li><a href="#modals">{{_i}}Modal{{/i}}</a></li>
            <li><a href="#dropdowns">{{_i}}Dropdown{{/i}}</a></li>
            <li><a href="#scrollspy">{{_i}}Scrollspy{{/i}}</a></li>
            <li><a href="#tabs">{{_i}}Tab{{/i}}</a></li>
            <li><a href="#tooltips">{{_i}}Tooltip{{/i}}</a></li>
            <li><a href="#popovers">{{_i}}Popover{{/i}}</a></li>
            <li><a href="#alerts">{{_i}}Alert{{/i}}</a></li>
            <li><a href="#buttons">{{_i}}Button{{/i}}</a></li>
            <li><a href="#collapse">{{_i}}Collapse{{/i}}</a></li>
            <li><a href="#carousel">{{_i}}Carousel{{/i}}</a></li>
            <li><a href="#typeahead">{{_i}}Typeahead{{/i}}</a></li>
          </ul>
        </div>
      </header>
      <!-- Using Javascript w/ Bootstrap
      ================================================== -->
      <section id="javascript">
        <div class="page-header">
          <h1>{{_i}}jQuery plugins{{/i}} <small>{{_i}}A dozen Bootstrap plugins to get you started{{/i}}</small></h1>
        </div>
      <div class="row">
        <div class="span3">
          <label>
            <h3><a href="./javascript.html#modals">{{_i}}Modals{{/i}}</a></h3>
            <p>{{_i}}A streamlined, but flexible, take on the traditional javascript modal plugin with only the minimum required functionality and smart defaults.{{/i}}</p>
          </label>
        </div>
        <div class="span3">
          <label>
            <h3><a href="./javascript.html#dropdowns">{{_i}}Dropdowns{{/i}}</a></h3>
            <p>{{_i}}Add dropdown menus to nearly anything in Bootstrap with this simple plugin. Bootstrap features full dropdown menu support on in the navbar, tabs, and pills.{{/i}}</p>
          </label>
        </div>
        <div class="span3">
          <label>
            <h3><a href="./javascript.html#scrollspy">{{_i}}Scrollspy{{/i}}</a></h3>
            <p>{{_i}}Use scrollspy to automatically update the links in your navbar to show the current active link based on scroll position.{{/i}}</p>
          </label>
        </div>
        <div class="span3">
          <label>
            <h3><a href="./javascript.html#tabs">{{_i}}Togglable tabs{{/i}}</a></h3>
            <p>{{_i}}Use this plugin to make tabs and pills more useful by allowing them to toggle through tabbable panes of local content.{{/i}}</p>
          </label>
        </div>
      </div> <!-- /row -->
      <div class="row">
        <div class="span3">
          <label>
            <h3><a href="./javascript.html#tooltips">{{_i}}Tooltips{{/i}}</a></h3>
            <p>{{_i}}A new take on the jQuery Tipsy plugin, Tooltips don't rely on images, uss CSS3 for animations, and data-attributes for local title storage.{{/i}}</p>
          </label>
        </div>
        <div class="span3">
          <label>
            <h3><a href="./javascript.html#popovers">{{_i}}Popovers{{/i}}</a> <small class="muted">*</small></h3>
            <p>{{_i}}Add small overlays of content, like those on the iPad, to any element for housing secondary information.{{/i}}</p>
            <p class="muted"><strong>*</strong> {{_i}}Requires <a href="#tooltips">Tooltips</a> to be included{{/i}}</p>
          </label>
        </div>
7172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
<div class="span3"> <label> <h3><a href="./javascript.html#alerts">{{_i}}Alert messages{{/i}}</a></h3> <p>{{_i}}The alert plugin is a tiny class for adding close functionality to alerts.{{/i}}</p> </label> </div> <div class="span3"> <label> <h3><a href="./javascript.html#buttons">{{_i}}Buttons{{/i}}</a></h3> <p>{{_i}}Do more with buttons. Control button states or create groups of buttons for more components like toolbars.{{/i}}</p> </label> </div> </div> <!-- /row --> <div class="row" style="margin-bottom: 9px;"> <div class="span3"> <label> <h3><a href="./javascript.html#collapse">{{_i}}Collapse{{/i}}</a></h3> <p>{{_i}}Get base styles and flexible support for collapsible components like accordions and navigation.{{/i}}</p> </label> </div> <div class="span3"> <label> <h3><a href="./javascript.html#carousel">{{_i}}Carousel{{/i}}</a></h3> <p>{{_i}}Create a merry-go-round of any content you wish to provide an interactive slideshow of content.{{/i}}</p> </label> </div> <div class="span3"> <label> <h3><a href="./javascript.html#typeahead">Typeahead</a></h3> <p>{{_i}}A basic, easily extended plugin for quickly creating elegant typeaheads with any form text input.{{/i}}</p> </label> </div> <div class="span3"> <label> <h3>{{_i}}Transitions{{/i}} <small class="muted">*</small></h3> <p>{{_i}}For simple transition effects, include bootstrap-transition.js once to slide in modals or fade out alerts.{{/i}}</p> <p class="muted"><strong>*</strong> {{_i}}Required for animation in plugins{{/i}}</p> </label> </div> </div> <!-- /row --> <div class="alert alert-info"><strong>{{_i}}Heads up!{{/i}}</strong> {{_i}}All javascript plugins require the latest version of jQuery.{{/i}}</div> </section> <!-- Modal ================================================== --> <section id="modals"> <div class="page-header"> <h1>{{_i}}Modals{{/i}} <small>bootstrap-modal.js</small></h1> </div> <div class="row"> <div class="span3 columns"> <h3>{{_i}}About modals{{/i}}</h3> <p>{{_i}}A streamlined, but flexible, take on the traditional javascript modal plugin with only the minimum required functionality and smart defaults.{{/i}}</p> <a href="assets/js/bootstrap-modal.js" target="_blank" class="btn">{{_i}}Download file{{/i}}</a> </div> <div class="span9 columns"> <h2>{{_i}}Static example{{/i}}</h2> <p>{{_i}}Below is a statically rendered modal.{{/i}}</p> <div class="well modal-example" style="background-color: #888; border: none;"> <div class="modal" style="position: relative; top: auto; left: auto; margin: 0 auto; z-index: 1"> <div class="modal-header"> <a href="#" class="close" data-dismiss="modal">&times;</a> <h3>{{_i}}Modal header{{/i}}</h3> </div> <div class="modal-body"> <p>{{_i}}One fine body…{{/i}}</p> </div> <div class="modal-footer">
141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
<a href="#" class="btn btn-primary">{{_i}}Save changes{{/i}}</a> <a href="#" class="btn">{{_i}}Close{{/i}}</a> </div> </div> </div> <!-- /well --> <h2>{{_i}}Live demo{{/i}}</h2> <p>{{_i}}Toggle a modal via javascript by clicking the button below. It will slide down and fade in from the top of the page.{{/i}}</p> <!-- sample modal content --> <div id="myModal" class="modal hide fade"> <div class="modal-header"> <a class="close" data-dismiss="modal" >&times;</a> <h3>{{_i}}Modal Heading{{/i}}</h3> </div> <div class="modal-body"> <h4>{{_i}}Text in a modal{{/i}}</h4> <p>Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem.</p> <h4>{{_i}}Popover in a modal{{/i}}</h4> <p>{{_i}}This <a href="#" class="btn 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 hover.{{/i}}</p> <h4>{{_i}}Tooltips in a modal{{/i}}</h4> <p>{{_i}}<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.{{/i}}</p> </div> <div class="modal-footer"> <a href="#" class="btn btn-primary">{{_i}}Save changes{{/i}}</a> <a href="#" class="btn" data-dismiss="modal" >{{_i}}Close{{/i}}</a> </div> </div> <a data-toggle="modal" href="#myModal" class="btn btn-primary btn-large">{{_i}}Launch demo modal{{/i}}</a> <hr> <h2>{{_i}}Using bootstrap-modal{{/i}}</h2> <p>{{_i}}Call the modal via javascript:{{/i}}</p> <pre class="prettyprint linenums">$('#myModal').modal(options)</pre> <h3>{{_i}}Options{{/i}}</h3> <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}}backdrop{{/i}}</td> <td>{{_i}}boolean{{/i}}</td> <td>{{_i}}true{{/i}}</td> <td>{{_i}}Includes a modal-backdrop element{{/i}}</td> </tr> <tr> <td>{{_i}}keyboard{{/i}}</td> <td>{{_i}}boolean{{/i}}</td> <td>{{_i}}true{{/i}}</td> <td>{{_i}}Closes the modal when escape key is pressed{{/i}}</td> </tr> </tbody> </table> <h3>{{_i}}Markup{{/i}}</h3> <p>{{_i}}You can activate modals on your page easily without having to write a single line of javascript. Just set <code>data-toggle="modal"</code> on a controller element with a <code>data-target="#foo"</code> or <code>href="#foo"</code> which corresponds to a modal element id, and when clicked, it will launch your modal.</p> <p>Also, to add options to your modal instance, just include them as additional data attributes on either the control element or the modal markup itself.{{/i}}</p> <pre class="prettyprint linenums"> &lt;a class="btn" data-toggle="modal" href="#myModal" &gt;{{_i}}Launch Modal{{/i}}&lt;/a&gt; </pre> <pre class="prettyprint linenums"> &lt;div class="modal"&gt;