JSFiddle - React, Tailwind, and code Playground

by Ronny

HTML

<button id="Button">Do</button>

CSS

.SmallLoader {
    width: 16px;
    height: 16px;
    background: url(http://s.mcstatic.com/Images/AjaxLoaders/16X16white.gif) center center no-repeat;
}

JavaScript

function longAction() {
    var p = new Element('progress.SmallLoader');
    this.set('disabled', 'disabled');
    p.inject(this, 'after');
    done.delay(2000);
}

function done(){
    $$('.SmallLoader').dispose();
    $('Button').set('disabled', '');
}


$('Button').addEvent('click', longAction);