This is very pretty, but there's no need for a larger, separate JS file. All of this can be handled with CSS and a simple JS command that adds/removes a CSS class on click. Quick demo: http://codepen.io/ultimatedelman/pen/klDHy Since you wouldn't obviously use all the effects in this article, just pick the one you would use and have the .loading class effect the correct change. UPDATE: now with fewer elements. Only H…
Buttons with built-in loading indicators
61–64 of 64 posts
Re: Buttons with built-in loading indicators
#62This is very pretty, but there's no need for a larger, separate JS file. All of this can be handled with CSS and a simple JS command that adds/removes a CSS class on click. Quick demo: http://codepen.io/ultimatedelman/pen/klDHy Since you wouldn't obviously use all the effects in this article, just pick the one you would use and have the .loading class effect the correct change. UPDATE: now with fewer elements. Only H…
The other nice touch in Ladda is that it disables the form button on activation. Again, given your demo, not hard to replicate with a `this.disabled=true` statement.
pointer-events: none;
cursor: not-allowed;
Re: Buttons with built-in loading indicators
#63This is also a nice solution http://fgnass.github.io/spin.js/
Re: Buttons with built-in loading indicators
#64Earlier quoted context omitted.
The other nice touch in Ladda is that it disables the form button on activation. Again, given your demo, not hard to replicate with a `this.disabled=true` statement.
You can also do this with CSS: pointer-events: none; cursor: not-allowed;