Ladda 是一组集成了加载提示的按钮,以弥合行动和反馈之间的时间间隔,提供更好的功能使用体验。主要用于在用户点击提交之后,向用户提供即时的反馈,让他们知道浏览器正在处用户提交的任务。
<button class="ladda-button ladda-button-demo btn btn-primary" data-style="zoom-in">Submit</button>
var l = $( '.ladda-button-demo' ).ladda(); 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) });