我使用 icheck 插件,并在单击/选中复选框时显示/隐藏 div
。
HTML:
<input tabindex="5" type="checkbox" id="minimal-checkbox-1" checked>checked
<div class="max_tickets">
<input type="text" name="opwp_wootickets[tickets][0][maxtickets]" />
</div>
JS:
$('input').iCheck({
checkboxClass: 'icheckbox_minimal',
radioClass: 'iradio_minimal',
increaseArea: '20%'
});
$('input').on('ifChanged', function () {
$(this).parent().next('.max_tickets').toggle(this.checked);
});
CSS:
max_tickets {display:none;}
现在,对于动态复选框,我需要在 icheck 输入中添加 checked
并默认显示 div
。
但默认情况下,我没有显示 display:none;
和 div
。
如何修复此问题并默认显示 max_tickets
div
?
最佳答案
关于javascript - icheck jQuery 插件显示/隐藏 DIV,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24250981/