Disable iCheck in a checkbox

1

I'm using the iCheck plugin to customize my page checkboxes. I have on a form some checkbox and I would like the iCheck to work in the checkbox which has the class with the name icheck and the others would stay the original way. Can you do this?

Thank you

    
asked by anonymous 16.02.2015 / 03:03

1 answer

1

Yes, it is possible. To start the iCheck in one or more fields is done through the jQuery selectors. An example to apply iCheck to all checkboxes and radios with the blue theme would look like this:

$('input[type="checkbox"], input[type="radio"]').iCheck({
    checkboxClass: 'icheckbox_square-blue',
    radioClass: 'iradio_square-blue'
 });

To select only the checkboxes and radios with the icheck class, simply include your class in the selector. For example:

$('input[type="checkbox"].icheck, input[type="radio"].icheck').iCheck({
    checkboxClass: 'icheckbox_square-blue',
    radioClass: 'iradio_square-blue'
 });
    
17.02.2015 / 06:42