<div id="normal-toggle-button"> <input type="checkbox" checked="checked"> </div>
$('#normal-toggle-button').toggleButtons();
Status is: false
<div id="callback-toggle-button"> <input type="checkbox"> </div>
$('#callback-toggle-button').toggleButtons({ onChange: function ($el, status, e) { console.log($el, status, e); $('#magic-text').text("Status is: " + status); } });
<div id="text-toggle-button"> <input type="checkbox"> </div>
$('#text-toggle-button').toggleButtons({ width: 220, label: { enabled: "Lorem Ipsum", disabled: "Dolor Sit" } });
<div id="danger-toggle-button"> <input type="checkbox" checked="checked"> </div>
$('#danger-toggle-button').toggleButtons({ style: { // Accepted values ["primary", "danger", "info", "success", "warning"] or nothing enabled: "danger", disabled: "info" } });
<div id="not-animated-toggle-button"> <input type="checkbox" checked="checked"> </div>
$('#not-animated-toggle-button').toggleButtons({ animated: false });
<div id="transition-percent-toggle-button"> <input type="checkbox" checked="checked"> </div> <div id="transition-value-toggle-button"> <input type="checkbox"> </div>
$('#transition-percent-toggle-button').toggleButtons({ transitionspeed: "500%" }); $('#transition-value-toggle-button').toggleButtons({ transitionspeed: 1 // default value: 0.05 });
<div id="disabled-toggle-button"> <input type="checkbox" checked="checked" disabled=""> </div>
$('#disabled-toggle-button').toggleButtons(); $('#disabled-toggle-button').toggleButtons('toggleActivation'); // to toggle the disabled state
<label for="checkbox14">Toggle me!</label> <div id="label-toggle-button"> <input id="checkboxLabel" type="checkbox" checked="checked"> </div>
$('#label-toggle-button').toggleButtons(); $('#label-toggle-button').toggleButtons('toggleState'); // to toggle the activation state
<label for="checkboxOne">one</label> <div class="toggle-button-class"> <input id="checkboxOne" type="checkbox" checked="checked"> </div> <label for="checkboxTwo">two</label> <div class="toggle-button-class"> <input id="checkboxTwo" type="checkbox" checked="checked"> </div> <label for="checkboxThree">three</label> <div class="toggle-button-class"> <input id="checkboxThree" type="checkbox" checked="checked" disabled=""> </div>
$('.toggle-button-class').toggleButtons();
<label for="checkboxMagenta">Magenta</label> <div id="magenta-toggle-button"> <input id="checkboxMagenta" type="checkbox"> </div> <label for="checkboxGradientMagenta">Gradient Magenta</label> <div id="gradient-magenta-toggle-button"> <input id="checkboxGradientMagenta" type="checkbox" checked="checked"> </div>
$('#magenta-toggle-button').toggleButtons({ style: { custom: { enabled: "#FF00FF", enabledColor: "#FFFFFF", disabled: "#FFAA00", disabledColor: "#333333" } } }); $('#gradient-magenta-toggle-button').toggleButtons({ style: { custom: { enabled: "#FF00FF", enabledGradient: "#D300D3", enabledColor: "#FFFFFF", disabled: "#FFAA00", disabledGradient: "#DD9900", disabledColor: "#333333" } } });
<div id="height-text-style-toggle-button"> <input type="checkbox" checked="checked"> </div>
$('#height-text-style-toggle-button').toggleButtons({ height: 100, font: { 'line-height': '100px', 'font-size': '20px', 'font-style': 'italic' } });
<div id="data-attribute-toggle-button" data-toggleButton-width="170" data-toggleButton-transitionspeed="500%" data-toggleButton-style-custom-enabled-background="#FF0000" data-toggleButton-style-custom-enabled-gradient="#000000"> <input type="checkbox" checked="checked"> </div>
$('#data-attribute-toggle-button').toggleButtons();
<div id="toggle-state-toggle-button"> <input type="checkbox" checked="checked"> </div>
$('#toggle-state-toggle-button').toggleButtons(); $('#toggle-state-toggle-button').toggleButtons('toggleState'); // to toggle the state of the toggle button $('#toggle-state-toggle-button').toggleButtons('setState', false); // true || false
<div id="destroy-toggle-button"> <input type="checkbox" checked="checked"> </div>
$('#destroy-toggle-button').toggleButtons(); $('#destroy-toggle-button').toggleButtons('destroy');