Live data from Hacker News

Buttons with built-in loading indicators

lab.hakim.se

61–64 of 64 posts

Re: Buttons with built-in loading indicators

#61

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…

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.

Re: Buttons with built-in loading indicators

#62

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…

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;

Re: Buttons with built-in loading indicators

#64

Earlier 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;

Though doesn't stop giving it focus and pressing it with the keyboard.
Post reply on HN