This page can be used to test that Ladda does NOT start spinning when submitting an invalid form.
A UI concept which merges loading indicators into the action that invoked them. Primarily intended for use with forms where it gives users immediate feedback upon submit rather than leaving them wondering while the browser does its thing. For a real-world example, check out any of the forms on slides.com.
================================================
FILE: site/index.js
================================================
import * as Ladda from '../js/ladda.js';
// Bind normal buttons
Ladda.bind('.button-demo button', { timeout: 2000 });
// Bind progress buttons and simulate loading progress
Ladda.bind('.progress-demo 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);
}
});
// You can control loading explicitly using the JavaScript API
// as outlined below:
// var l = Ladda.create( document.querySelector( 'button' ) );
// l.start();
// l.stop();
// l.toggle();
// l.isLoading();
// l.setProgress( 0-1 );
================================================
FILE: site/rtl.html
================================================