Having error while disabling switcher with jquery
HTML:
<input type="checkbox" class="js-switch" onchange="SetRemindme(this.checked);" id="remindmebtn">
jQuery:
var chkReminder = $("#remindmebtn"); var switchReminder = new Switchery(chkReminder); switchReminder.disable();
Plugin:
Switchery.prototype.disable = function () { debugger; if (!this.options.disabled) this.options.disabled = true; if (!this.element.disabled) this.element.disabled = true; if (!this.element.readOnly) this.element.readOnly = true; this.switcher.style.opacity = this.options.disabledOpacity; this.destroy(); };
this line this.switcher.style.opacity = this.options.disabledOpacity; shows error in google chrome console : Uncaught TypeError: Cannot read property 'style' of undefined
Please take a look at this issue.
Thanks.
I have the same problem
Update your apps to 0.8.2 and LMK if that problem still persists. Thanks.
Hi. I'm having the same problem when I'm using the function setPosition to return the switch to the "checked" position.
var switchry = new Switchery(input, { size: 'small' });
switchry.setPosition(true);
Where input is a var who receives the element var input = $(el);.
The console is showing this error:
Uncaught TypeError: Cannot read property 'style' of undefined at Switchery.setPosition (switchery.js:1699)
I just downloaded the new version of the code.
Thank you so very much.