将加载指示符合并到调用它们的动作中的UI概念。主要用于表单,它可以让用户在提交时立即提供反馈,而不是让浏览器做其事情时想知道。
<button class="ladda-button ladda-button-demo btn btn-primary" data-style="zoom-in">Submit</button>
var l = Ladda.bind('.ladda-button-demo'); l.click(function() // Start loading l.ladda( 'start' ); // Do something in backend and then stop ladda // setTimeout() is only for demo purpose setTimeout(function() l.ladda('stop'); },2000) });