class
flagrate.Switch
Example
var sw = flagrate.createSwitch().insertTo(x);
sw.on('on', function () {
console.log('on');
});
sw.on('off', function () {
console.log('off');
});
sw.on('change', function (e) {
console.log(e.target.isOn());
});
Structure
<button class="flagrate flagrate-button flagrate-switch"></button>
Events
on
: when the switch is turned on.off
: when the switch is turned off.change
: when the on/off status is changed.