dimanche 13 novembre 2016

Switchery as radio button, cannot toggle back

Now making playlist using switchery checkbox, and already make it like a radio button,

but it cant toggle back.

How can i make Switchery back to idle state / unchecked state ??

my Fiddle Demo <<<

$(document).ready(function() {
       //switchery
       var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));

       elems.forEach(function(html) {
          var switchery = new Switchery(html,{size: 'small',});
       });

       //detect change 
       $('input.pinmusic').on('change', function() { //detect change 
          $('.pinmusic').not(this).prop('checked', false); //auto uncheck
       });
});

PS : its already checked, but only switchery get stuck. already browse some topic of switchery here but still error.




Aucun commentaire:

Enregistrer un commentaire