数据切换按钮单选

数据切换按钮单选

本文介绍了Bootstrap 3 数据切换按钮单选的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

按钮收音机似乎不再适用于 Bootstrap 3

<button class="btn btn-default" value="1" type="button" >1</button><button class="btn btn-default" "value="2" type="button" >2</button>

它已被单选按钮输入所取代.有什么办法可以把一个按钮组中唯一允许勾选的按钮带回来吗?我需要能够在选择一项后完全取消选中该组,以便单选按钮不起作用.

这最终成为我在 BS3 中继续使用无线电类型按钮的答案:

$(this).addClass("current").siblings().removeClass("active");

解决方案

这最终成为我在 BS3 中继续使用无线电类型按钮的答案:

$(this).addClass("current").siblings().removeClass("active");

It seems buttons-radio no longer works in Bootstrap 3

<div class="btn-group" data-toggle="buttons-radio">
    <button class="btn btn-default" value="1" type="button" >1</button>
    <button class="btn btn-default" "value="2" type="button" >2</button>
</div>

It has been replaced with radio button inputs. Is there any way to bring back the only one button allowed to be checked in a group with buttons? I need to be able to have the group be totally unpicked after one item has been selected so radio buttons won't do.

This ended up being the answer for me to keep using buttons in a radio type in BS3:

$(this).addClass("current").siblings().removeClass("active");

解决方案

This ended up being the answer for me to keep using buttons in a radio type in BS3:

$(this).addClass("current").siblings().removeClass("active");

这篇关于Bootstrap 3 数据切换按钮单选的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 04:21