Well, I had a similar problem once and solved it like this:
Assuming the variable el is a jQuery element, I will bind the initialization of the iCheck plugin to a full load of el , therefore:
This code should be posted after adding AJAX data.
el.ready(function() { $('#container input').iCheck({ checkboxClass: 'icheckbox_flat-green', radioClass: 'iradio_flat-green'
Remember to adapt the code to your HTML structure. Running the above code immediately after adding elements to the page that you initialize iCheck from these newly added elements, however, if you use iCheck callbacks, the plugin will work only if you correctly declare these callbacks, delegating events to the appropriate tags, like Florin .
This code should be placed in the first iCheck initialization
$(document).on('ifChecked', '#mycheckbox', function() { $(this).addClass('selected'); }); $(document).on('ifUnchecked', '#mycheckbox', function() { $(this).removeClass('selected'); });
source share