我正在使用 iCheck 插件来自定义复选框。我需要在选中一个或多个复选框时显示某些文本,并在未选中时隐藏文本。
我目前拥有的代码在第一次单击时显示文本,但除非我再单击 2 次,否则不会隐藏它。我有多个复选框,如果选中其中一个复选框,我想显示文本,否则隐藏文本。有人知道吗?该插件有:
ifChecked
ifChanged
ifClicked
ifUnchecked
ifToggled
ifDisabled
ifEnabled.......
回调......这是插件功能
$('input').iCheck({
checkboxClass: 'icheckbox_square-blue',
radioClass: 'iradio_square-blue',
increaseArea: '20%' // optional
});
这是我尝试过的..
$('input').on('ifChecked', function(event){
$(".hide").toggle();
});
html
<input type="checkbox">
<div class"hide" style="display:none">Hi there</div>