Closed CharlyPoppins closed 9 years ago
Hi, i have a similiar problem
$(document).ready(function(){ $('.feed').iCheck({ checkboxClass: 'icheckbox_square-green', radioClass: 'iradio_square-green', increaseArea: '20%' // optional }); });
i want to give 'active' state on the label if it's radio button checked, i use these codes below but none of them are working... 1.
$('.feed').on('ifChecked', function(){ $('.iradio_square-green.checked').siblings('label').addClass('active'); });
2.
$('.feed').on('ifChecked', function(){ if ($(this).parent('.iradio_square-green').hasClass('checked')){ $(this).parent('.iradio_square-green').siblings('.label').addClass('active'); $('.content-item .feed_backform .itemlabel').not($(this).parent('.iradio_square-green').siblings(' label')).removeClass('active'); } });
Still haven't found yet...
You should bind events before iCheck initialization
I use ifChanged on both radio and checkbox, and trigger the change event of the input, then I bind .change on radios that find a checkbox, check the input and update the iCheck object.
$('.tree input').on('ifChanged', function (event) { $(event.target).trigger('change'); });
$('.tree input[type="radio"]').change(function() {
// find an input
$(input).attr('checked', this.checked);
$(input).iCheck('update');
}
Hi, trying ti use callbacks but it didn't work
What am I missing ?