switchery

Jquery Switchery checkbox disable created new checkbox on page

橙三吉。 提交于 2021-01-07 01:44:34
问题 i struggle to disable the Switchery checkbox but it creates me another Switchery checkbox on page . i first define the checkbox which is working great: <div class="form-group"> <label class="col-md-2"> Additional Options </label> <div class="col-md-3"> <div class=""> <label> <input type="checkbox" id="foo1" name="foo1" class="js-switch"/> </label> </div> </div> </div> now after the page loaded, i dynamically want to disable the checkbox so I do : var foo1= document.getElementById('foo1') var

Jquery Switchery checkbox disable created new checkbox on page

╄→尐↘猪︶ㄣ 提交于 2021-01-07 01:42:12
问题 i struggle to disable the Switchery checkbox but it creates me another Switchery checkbox on page . i first define the checkbox which is working great: <div class="form-group"> <label class="col-md-2"> Additional Options </label> <div class="col-md-3"> <div class=""> <label> <input type="checkbox" id="foo1" name="foo1" class="js-switch"/> </label> </div> </div> </div> now after the page loaded, i dynamically want to disable the checkbox so I do : var foo1= document.getElementById('foo1') var

Wrapping Switchery in a Directive VueJS

心已入冬 提交于 2019-12-12 03:36:23
问题 I am trying to wrap the Switchery iOS 7 in a Vue Directive but I had no success until now! Somebody to help me? There is my code fiddle. JS Vue.directive('plSwitchery', { twoWay: true, deep: true, params: [], bind: function() { var self = this, value = self.value, el = self.el; el.checked = true; new Switchery(el); $(el).on('change', function(a) { value = !value; self.set(value); alert(self.value); }); }, update: function(value) { window.console.log('directive update'); }, unbind: function()