Iām working on a bootstrap switcher and I want to change the panel color from grey to green when the checkbox (switch) is checked. I had it working before, but after updating the switcher, it no longer functions properly.
Here is the main code for the switcher:
<label class="switch-light well" onclick="">
<input type="checkbox">
<span>
Wireless
<span>Off</span>
<span>On</span>
</span>
<a class="btn btn-primary"></a>
</label>
And here is the jQuery toggleclass code:
$(document).ready(function () {
$('.switch-light').bootstrapSwitch();
$('.switch-light').on('input:checked', function () {
$("#tasksList > div > div.panel").toggleClass("panel-off2 panel-off", this.checked).toggleClass("panel-success", !this.checked);
}).change()
});
You can view my jsfiddle here: http://jsfiddle.net/CYLcY/