前端页面中有时需要在js中拼接内容,但是js拼接的内容bootstrap是不渲染的,导致页面的样式不统一,所以需要重新渲染一遍。
下拉框重新渲染
// 渲染js拼接的select按钮
$("select").selectpicker({
actionsBox:true, //在下拉选项添加选中所有和取消选中的按钮
countSelectedText:"已选中{0}项",
selectedTextFormat:"count > 5",
multiple:"true"
})
单选、复选按钮重新渲染
// 渲染js拼接的radio,checkbox按钮
$('input[type=radio],input[type=checkbox]').iCheck({
labelHover : false,
cursor : true,
checkboxClass : 'icheckbox_square-blue',
radioClass : 'iradio_square-blue',
increaseArea : '20%'
});