danny danny - 5 months ago 21
CSS Question

Toggle drop down by clicking caret in bootstrap

Is it possible to have the drop down top link to another web page and then toggle the drop down by clicking the caret next to the drop down text?

<li class="dropdown">
<a class="disabled" href="http://google.com">
Dropdown <b class="caret dropdown-toggle" data-toggle="dropdown"></b>
</a>

<ul class="dropdown-menu">
<li><a href="#">Link 1</a></li>
<li><a href="#">Link 2</a></li>
</ul>
</li>


Is it possible for one to call the data-toggle="dropdown" function from tag?

Answer

I think you just want to move the caret outside of the google linked anchor:

  <a class="disabled" href="http://google.com">Dropdown</a>
  <a class="dropdown-toggle" data-toggle="dropdown"><b class="caret"></b></a>

See fiddle: http://jsfiddle.net/xwetvL3y/2/

Comments