dimanche 22 mai 2016

Materialize intermediate checkbox state

How do I get a checkbox to show as "intermediate" when unchecked in Materialize ?

HTML:

<input type="checkbox" id="test" checked/>
<label for="test" id="test-label">Red</label>

JS:

$('#test-label').click(function() {
    var checkbox = $(this).prev();
    if (!$(checkbox).is(':checked'))
        $(checkbox).prop('intermediate', true);
});

http://ift.tt/27N8pK1




Aucun commentaire:

Enregistrer un commentaire