Bootstrap-based ultra-cool jquery switch button plugin

Source: Internet
Author: User

Bootstrap switch button plug-in use.

Start by referencing bootstrap styles, scripts, and jquery.

<Linkrel= "stylesheet"href= "Static/stylesheets/bootstrap-switch.css" /><Scriptsrc= "Http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></Script>                <Scriptsrc= "Static/js/bootstrap-switch.js"></Script>

Second, using the HTML language in the code, the checked represents the "on" state of the selection.

<name= "OP1"  ID= "$bean. Id"  type= " CheckBox "/>

Again, in the initialization scripting language, the control is styled for initialization.

$ ("Input[name= ' OP1 ')"). Bootstrapswitch ({                                "small",                                "Danger",                                "open",                                 "Close"                            });

Finally, in the initialization scripting language, the control is bound in a method.

$ ("Input[name= ' OP1 ')"). On (' Switchchange.bootstrapswitch ',                                            function(E, state) {varID = $ ( This). attr ("id"); if(state = =false) {alert (Note: This item will not accept data sent by the instrument when it is closed. "); $("#" +ID). Bootstrapswitch ( "State",                                                                    false); } Else {                                                    $("#" +ID). Bootstrapswitch ( "State",                                                                    true); }                                            });


Reference: http://www.cnblogs.com/tanhehe/p/4263824.html

Http://www.htmleaf.com/jQuery/Buttons-Icons/201502051331.html

Bootstrap-based ultra-cool jquery switch button plugin

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.