役に立ちましたか?

解決

通常のチェックボックスではなく、実際にサポートしているイベントをリッスンする必要があります。

$('#checkbox1').on('ifChanged', function(){
    $('.selectpicker').attr('disabled', this.checked).selectpicker('refresh');
}).iCheck({
    checkboxClass: 'icheckbox_flat-red',
    radioClass: 'iradio_flat-red' 
});
.

href="http://jsfiddle.net/36xpf/1/" REL="nofollow"> フィドル

他のヒント

    $('input#checkbox1').iCheck({
    checkboxClass: 'icheckbox_flat-red',
    radioClass: 'iradio_flat-red' 
});
$('.selectpicker').selectpicker();


$(document).on('ifChecked','#checkbox1',function(){
      $('.selectpicker').prop('disabled',true);
     $('.selectpicker').selectpicker('refresh');
});
$(document).on('ifUnchecked','#checkbox1',function(){
     $('.selectpicker').prop('disabled',false);
     $('.selectpicker').selectpicker('refresh');
});


/*standard checkbox*/
$('#checkbox2').change(function(){
  if (this.checked) {
    $('.standard').attr('disabled', true);
  } else {
    $('.standard').attr('disabled', false);
  }                   
});
.

このJSコードを使用する

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top