Wednesday, June 5, 2024
 Popular · Latest · Hot · Upcoming
197
rated 0 times [  198] [ 1]  / answers: 1 / hits: 76686  / 12 Years ago, sat, august 25, 2012, 12:00:00

I'm trying to get this exact example working on my website:



http://getbootstrap.com/2.3.2/javascript.html#buttons



However, simply including this HTML:



<button type=button class=btn btn-primary data-loading-text=Loading...>Loading state</button>


Does not work. I'm running jQuery 1.7.x and have loaded the Bootstrap JS files.



To be specific: I want the button to move to the loading text change for a slight delay, then go back to the regular text. There doesn't seem to be a good example available online from my Googling (most are asking for a permanent state change or toggle), and the Bootstrap site itself is lacking in documentation here.


More From » jquery

 Answers
67

In the documentation page, there is a file being loaded called application.js. http://twitter.github.com/bootstrap/assets/js/application.js



// button state demo
$('#fat-btn')
.click(function () {
var btn = $(this)
btn.button('loading')
setTimeout(function () {
btn.button('reset')
}, 3000)
});

[#83437] Thursday, August 23, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
reina

Total Points: 241
Total Questions: 82
Total Answers: 94

Location: New Caledonia
Member since Thu, Mar 23, 2023
1 Year ago
reina questions
;