olance/jQuery-switchButton — pull request #8 by faisalbegins (2014-01-23 06:49:26+00:00)
Title: added callback function support for on/off state change, so that user ca...

Callback support for for on & off state. When user click on/off button they may want to do some other thing too. To support this I have added callback support to on/off state.

on_callback, callback that will be executed after on state.
off_callback, callback that will be executed after off sate.

uses are given bellow,

('#switch').switchButton({
on_callback: function() {
console.log('this will be executed after on state');
},
off_callback: function() {
console.log('this will be executed after off state');
},
labels_placement: "left",
on_label: 'ON',
off_label: 'OFF'
});