View on GitHub

default

                
                    var mySwitch = new Switch(el);
                
            

size

                
                    var mySwitch1 = new Switch(el, {size: 'small'});
                    var mySwitch2 = new Switch(el, {size: 'default'});
                    var mySwitch3 = new Switch(el, {size: 'large'});
                
            

checked

                
                    var mySwitch1 = new Switch(el, {checked: false});
                    var mySwitch2 = new Switch(el, {checked: true});
                
            

text

            
                var mySwitch = new Switch(el, {
                    showText: true,
                    onText: 'O',
                    offText: 'X'
                });
            
        

color

            
                var mySwitch = new Switch(el, {
                    onSwitchColor    : '#34B363',
                    offSwitchColor   : '#D6B3A3',
                    onJackColor      : '#1453B3',
                    offJackColor     : '#A4B363'
                });
            
        

disabled

                
                    var mySwitch = new Switch(el, {disabled: true});
                
            

API

                
                    var mySwitch = new Switch(el);

                    mySwitch.on();
                    mySwitch.off();
                    mySwitch.toggle();
                    mySwitch.disable();
                    mySwitch.enable();
                
            

destroy

                
                    var mySwitch = new Switch(el);

                    mySwitch.destroy();
                
            

remove

                
                    var mySwitch = new Switch(el);

                    mySwitch.remove();