Button of the js plug-in of Bootstrap)

Source: Internet
Author: User

Button of the js plug-in of Bootstrap)

1) attributes:

Data-loading-text = loading... -- display the button loading status;

Data-toggle = button -- enables the button to switch status;

Data-toggle = buttons -- enables the button group to have the select/cancel function similar to the selection box;

Autocomplete = off -- solve the FireFox compatibility problem: FireFox keeps the button disabled between multiple page loads;

2) method:

$ (). Button (toggle) -- switch button status;

$ (). Button (loading) -- set the button status to loading-set the button to disabled and switch the text content to loading;

$ (). Button (reset) -- reset button status-and restore the text on the button to the original value;

$ (). Button (string) -- reset button status-and reset the text on the button to the input value.

For more details, see examples:

 

     <Script src = js/jquery-2.1.3.min.js> </script> <script src = js/bootstrap. min. js> </script>    Button. js example Submit comments Comment Sales priority  Price first  Distance priority Sichuan food  Hunan food  Cantonese cuisine Make sure you are 18 years old!<Script> // click the button to change the text to loading ..., restore in 3 seconds $ (. js-loading-btn ). on (click, function () {var btn = $ (this ). button (loading); setTimeout (function (e) {btn. button (reset)}, 3000) ;}; $ (. mybtn ). on (click, function (e) {$ (this ). button ('complete'); $ (this ). removeClass ('btn-warning'); $ (this ). addClass ('btn-primary ') ;}); </script> 


 

 

Related Article

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.