Bootstrap-toggle-buttons ======================== Demo ---- http://www.larentis.eu/bootstrap_toggle_buttons/ Usage ----- Just include Twitter Bootstrap, jQuery and Bootstrap Toggle Buttons CSS and Javascript ``` html ``` Basic Example ------------- HTML ``` html
``` JS ``` javascript $('#toggle-button').toggleButtons(); ``` Full Example ------------ HTML ``` html
``` JS ``` javascript $('#toggle-button').toggleButtons({ onChange: function ($el, status, e) { // $el = $('#toggle-button'); // status = [true, false], the value of the checkbox // e = the event console.log($el, status, e); }, width: 100, height: 25, font: { 'font-size': '20px', 'font-style': 'italic' }, animated: true, transitionspeed: 1, // Accepted values float or "percent" [ 1, 0.5, "150%" ] label: { enabled: "ON", disabled: "OFF" }, style: { // Accepted values ["primary", "danger", "info", "success", "warning"] or nothing enabled: "primary", disabled: "danger", custom: { enabled: { background:"#FF00FF", gradient: "#D300D3", color: "#FFFFFF" }, disabled: { background: "#FFAA00", gradient: "#DD9900", color: "#333333" } } } }); $('#toggle-button').toggleButtons('toggleActivation'); // to toggle the disabled status ``` Data Attributes Example ----------------------- HTML ``` html
``` JS ``` javascript $('#data-attribute-toggle-button').toggleButtons(); ``` Toggle state ------------ JS ``` javascript $('#my-toggle-button').toggleButtons('toggleState'); ``` Destroy ------- JS ``` javascript $('#my-toggle-button').toggleButtons('destroy'); ``` Like this project? ------------------ [![endorse](http://api.coderwall.com/nostalgia/endorsecount.png)](http://coderwall.com/nostalgia)