0
我需要工作按鈕與進度條like here。我已經建立了資源,js綁定,但由於某種原因,按鈕沒有像示例中那樣工作。如何解決它?如何使用內置進度條獲取工作按鈕動畫?
我的代碼:
<button class="progress-button ladda-button" data-color="mint" data-style="expand-right" data-size="xl" name="sendRequest"> <span class="ladda-label">Submit</span>
<span class="ladda-spinner"></span>
<div class="ladda-progress" style="width: 160px;"></div>
</button>
Ladda.bind('.ladda-button .progress-button button', {
callback: function (instance) {
var progress = 0;
var interval = setInterval(function() {
progress = Math.min(progress + Math.random() * 0.1, 1);
instance.setProgress(progress);
if (progress === 1) {
instance.stop();
clearInterval(interval);
}
}, 200);
}
});
http://jsfiddle.net/RCola/4p2jke75/
UPDATE:
我下面的教程,但還是可以找到什麼是錯我的jsfiddle代碼。如何讓它工作?