1
0
Fork 0
mirror of https://github.com/twbs/bootstrap.git synced 2022-11-09 12:25:43 -05:00

clarify use of dropdowns, href, and data-target for js docs; add tests to css tests page for it's display and execution in html

This commit is contained in:
Mark Otto 2012-03-31 12:31:56 -07:00
parent 37745cd899
commit 56ecc6ba96
4 changed files with 71 additions and 0 deletions

Binary file not shown.

View file

@ -493,6 +493,20 @@ $('#myModal').on('hidden', function () {
</li>
...
&lt;/ul&gt;</pre>
<p>To keep URLs intact, use the <code>data-target</code> attribute instead of <code>href="#"</code>.</p>
<pre class="prettyprint linenums">
&lt;ul class="nav nav-pills"&gt;
&lt;li class="dropdown"&gt;
&lt;a class="dropdown-toggle" data-toggle="dropdown" data-target="#" href="path/to/page.html"&gt;
Dropdown
&lt;b class="caret"&gt;&lt;/b&gt;
&lt;/a&gt;
&lt;ul class="dropdown-menu"&gt;
...
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
</pre>
<h3>Methods</h3>
<h4>$().dropdown()</h4>
<p>A programatic api for activating menus for a given navbar or tabbed navigation.</p>

View file

@ -416,6 +416,20 @@ $('#myModal').on('hidden', function () {
&lt;/li&gt;
...
&lt;/ul&gt;</pre>
<p>{{_i}}To keep URLs intact, use the <code>data-target</code> attribute instead of <code>href="#"</code>.{{/i}}</p>
<pre class="prettyprint linenums">
&lt;ul class="nav nav-pills"&gt;
&lt;li class="dropdown"&gt;
&lt;a class="dropdown-toggle" data-toggle="dropdown" data-target="#" href="path/to/page.html"&gt;
{{_i}}Dropdown{{/i}}
&lt;b class="caret"&gt;&lt;/b&gt;
&lt;/a&gt;
&lt;ul class="dropdown-menu"&gt;
...
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
</pre>
<h3>{{_i}}Methods{{/i}}</h3>
<h4>$().dropdown()</h4>
<p>{{_i}}A programatic api for activating menus for a given navbar or tabbed navigation.{{/i}}</p>

View file

@ -330,8 +330,51 @@
</div><!--/row-->
</div>
<br>
<!-- Dropdowns
================================================== -->
<div class="page-header">
<h1>Dropdowns</h1>
</div>
<h4>Dropdown link with hash URL</h4>
<ul class="nav nav-pills">
<li class="active"><a href="#">Link</a></li>
<li><a href="#">Example link</a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
Dropdown <span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li class="divider"></li>
<li><a href="#">Separated link</a></li>
</ul>
</li>
</ul>
<h4>Dropdown link with custom URL and data-target</h4>
<ul class="nav nav-pills">
<li class="active"><a href="#">Link</a></li>
<li><a href="#">Example link</a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" data-target="#" href="path/to/page.html">
Dropdown <span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li class="divider"></li>
<li><a href="#">Separated link</a></li>
</ul>
</li>
</ul>