利用jQuery和bootstrap更改radio样式
并利用图标glyphicon代替radio单选框原有的“圆点”选择区
<div class="container body-content">
<div class="row">
<div class="text-center col-xs-12">
<h3>标题</h3>
<div class="well well-sm">
<div class="btn-group" data-toggle="buttons" id="Select">
<!-- 更改radio传统样式,label与btn绑定可以提高用户的体验效果,增大选区范围,但是btn样式会将“圆点”选择区覆盖掉,
可以利用图标glyphicon代替原有的“圆点”选择区-->
<label class="btn btn-default">
<span class="glyphicon glyphicon-unchecked"></span>
<input type="radio" /> 选择一
</label>
<label class="btn btn-default">
<span class="glyphicon glyphicon-unchecked"></span>
<input type="radio" /> 选择二
</label>
<label class="btn btn-default">
<span class="glyphicon glyphicon-unchecked"></span>
<input type="radio" /> 选择三
</label>
</div>
</div>
</div>
</div>
</div>
找了好久。。希望大家别再为这个问题而苦恼。。。
本文介绍如何使用jQuery和Bootstrap框架更改radio按钮的传统样式,通过利用glyphicon图标替代原有“圆点”选择区,增强用户体验及选区范围。示例代码展示了如何实现这一功能。
902

被折叠的 条评论
为什么被折叠?



