如何禁用Bootstrap的按钮下拉菜单 [英] How to disable Bootstrap's Button dropdown
本文介绍了如何禁用Bootstrap的按钮下拉菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
链接在这里:引导按钮下拉列表
我想禁用此按钮下拉菜单,我在<a>
中添加了disabled
类,但仍可以通过单击下拉按钮来打开下拉菜单.有什么想法吗?
I'd like to disable this button dropdown, i added disabled
class to <a>
but the dropdown can still be opened by clicking the dropdown button. Any ideas?
推荐答案
将disabled
类添加到按钮...
Add disabled
class to the button...
<div class="btn-group">
<button class="btn btn-primary dropdown-toggle disabled" data-toggle="dropdown">Action <span class="caret"></span></button>
<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>
</div>
在通过引导站点进行编辑时有效.我确实注意到他们没有像他们的示例那样使用锚点.
That works when editing via bootstraps site. I did notice that they're not using the anchor like their example.
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
这篇关于如何禁用Bootstrap的按钮下拉菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文