<div dir="ltr">Right, so that didn't work if the check-box was disabled (like in wifi)- but this does seem to work!<br><div><br></div><div> var $sld = $(this).closest('.slider'), $cbi = $sld.find('.slider-enable'), data = $.extend({ checked: ($cbi.prop("type") === "hidden" || $cbi.prop("checked")) }, $sld.data());<br></div><div><br></div><div>//.ichael</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 27 Dec 2022 at 11:04, Michael Geddes <<a href="mailto:frog@bunyip.wheelycreek.net">frog@bunyip.wheelycreek.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi all,<br></div><div>I've noticed that if you create a 'slider' widget with a checkbox that if it's unchecked when it first loads, then the slider is enabled. If you check/uncheck then the slider is disabled. Or at least that's what I seen in google chrome.</div><div><br></div><div>I'm really not familiar with NodeJS, but this _seems_ to fix the problem:</div><div><br></div><div>Does this fix make sense? If so - I'll do a p/r for it.</div><div><br></div><div>//.ichael </div><div><br></div><div><br></div>* Slider widget plugin<br> */<br> <br> $.fn.slider = function(options) {<br> return this.each(function() {<br>- <font color="#ff0000">var $sld = $(this).closest('.slider'), data = $.extend({ checked: true }, $sld.data());</font><br>+ <font color="#38761d"> var $sld = $(this).closest('.slider'), $cbi = $sld.find('.slider-enable'), data = $.extend({ checked: $cbi.prop("checked") }, $sld.data());</font><br> var opts = (typeof options == "object") ? options : data;<br> // init?<br> if ($sld.children().length == 0) {<br> var id = $sld.attr('id');<br> $sld.html('\<br></div>
</blockquote></div>