I use Ladda to introduce some loading effects on form buttons. Watch Ladda Demo
The effect I use is zoom-out . This works, but the spinner does not show. Is something 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 ); } );
Resources I upload:
- ladda-themeless.min.css
- ladda.min.js
- spin.min.js
javascript jquery
henrywright
source share