73
rated 0 times
[
80]
[
7]
/ answers: 1 / hits: 18710
/ 10 Years ago, tue, march 18, 2014, 12:00:00
I'm using Ladda to introduce some loading effects on my form buttons. See the Ladda demo
The effect I'm using is zoom-out
. This works but the spinner doesn't show. Is there something I'm missing?
My button:
<button type=submit class=ladda-button data-style=zoom-out name=submit>
<span class=ladda-label>Submit</span>
<span class=ladda-spinner></span>
</button>
My JS script (taken from here):
var buttons = document.querySelectorAll( '.ladda-button' );
Array.prototype.slice.call( buttons ).forEach( function( button ) {
var resetTimeout;
button.addEventListener( 'click', function() {
if( typeof button.getAttribute( 'data-loading' ) === 'string' ) {
button.removeAttribute( 'data-loading' );
}
else {
button.setAttribute( 'data-loading', '' );
}
clearTimeout( resetTimeout );
resetTimeout = setTimeout( function() {
button.removeAttribute( 'data-loading' );
}, 3000 );
}, false );
} );
The resources I'm loading are:
- ladda-themeless.min.css
- ladda.min.js
- spin.min.js
More From » jquery