Home > Web Front-end > JS Tutorial > Bootstrap changes button loading status_javascript skills

Bootstrap changes button loading status_javascript skills

WBOY
Release: 2016-05-16 16:29:46
Original
1469 people have browsed it

When there is an activation button in bootstrap, the button becomes unavailable;

According to the method introduced on the official website, add a data-loading-text="Loading..." attribute to the button button, and then the overall js code is as follows:

Copy code The code is as follows:

<script><br> $('#myButton').on('click', function () {<br> var $btn = $(this).button('loading')<br> // business logic...<br> $btn.button('reset')<br> })<br> </script>

The autocomplete="off" attribute is used so that the disabled state will not be automatically lifted after the FF browser loads the page.
When I used the above code directly, I found that there was no loading status.
Then I changed it myself and wrote it like this, and it was OK

Copy code The code is as follows:

<script><br> //Used for smile login button and review button to change button loading status<br> Function loag() {<br> var btn = $("#btn_login");<br> btn.button('loading');<br> setTimeout(function () { btn.button('reset'); },2000);<br> }<br> </script>

With just a few changes, we can achieve our requirements. I don’t know if the official version was put up without testing. Here I recommend the solution to my friends.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template