How can I use Twitter Bootstrap Dropdowns to include the first item as a
toggle?
Twitter Bootstrap Dropdowns Docs show the following syntax for a dropdown:
<div class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Dropdown
trigger</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
<li role="presentation"><a role="menuitem" tabindex="-1"
href="#">Menu Item 1</a></li>
...
</ul>
</div>
But instead I'd like the first item (Drowdown trigger above) to be
included in the menu items.
Can you suggest a strategy to trigger a dropdown menu from a list
including all items?
Here's an example HTML format of what I'm after.
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
<li role="presentation"><a class="dropdown-toggle btn"
data-toggle="dropdown" href="#">General Support <b
class="caret"></b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1"
href="#">Sales</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1"
href="#">Accounting</a></li>
</ul>
My actual use case is a little more complex and is the reason I can't
simply use an HTML select input.
No comments:
Post a Comment