mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-11 08:54:23 +01:00
Fix dropdown example in docs (Fix #20410)
This commit is contained in:
parent
27cf3d675c
commit
0f25df1dff
@ -36,7 +36,7 @@ And with `<a>` elements:
|
|||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<div class="dropdown open">
|
<div class="dropdown open">
|
||||||
<a class="btn btn-secondary dropdown-toggle" href="http://example.com" id="dropdownMenuLink" data-target="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
<a class="btn btn-secondary dropdown-toggle" href="http://example.com" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
Dropdown link
|
Dropdown link
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
@ -500,20 +500,6 @@ Add `data-toggle="dropdown"` to a link or button to toggle a dropdown.
|
|||||||
</div>
|
</div>
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
To keep URLs intact with link buttons, use the `data-target` attribute instead of `href="#"`.
|
|
||||||
|
|
||||||
{% highlight html %}
|
|
||||||
<div class="dropdown">
|
|
||||||
<a id="dLabel" data-target="#" href="http://example.com" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
||||||
Dropdown trigger
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<div class="dropdown-menu" aria-labelledby="dLabel">
|
|
||||||
...
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endhighlight %}
|
|
||||||
|
|
||||||
### Via JavaScript
|
### Via JavaScript
|
||||||
|
|
||||||
Call the dropdowns via JavaScript:
|
Call the dropdowns via JavaScript:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user