JSFiddle - React, Tailwind, and code Playground
by ghazal
HTML
<h2 class="dialog_title">
<span id="login_text">Login</span></h2>
<div id="orgPannel_left" class="left">
<p style="margin-top:50px;">Où vais-je ?</p>
</div>
<div id="buttton"><a href="#">Essai à transformer</a></div>
CSS
.spinner {z-index: 999;}
.spinner-msg { text-align: center; color:green;}
.spinner-img {
background:#FFF url(http://www.opteynde.com/images/facebox_indicator.gif) no-repeat;width:
24px;height: 24px;margin: 0 auto;}
JavaScript
$('buttton').addEvent('click', function(e){
if(e) e.stop();
$('login_text').set('text','Enregistré');
var timer;
new Request.HTML ({
url: '/echo/html/',
spinnerTarget: $('spin'),
useSpinner: true,
spinnerOptions: {
message: "Patientez, ça va viendre, bientôt, quand tu veux, voilà, on va y être ...."
},
data: {
'html': "request complete"
},
method: 'post',
update: $('orgPannel_left'),
onRequest: function() {
timer = (function() {
this;
}).delay(3000);
},
onComplete: function() {
$('orgPannel_left').highlight('#fff','#6D84B4');
},
onSuccess: function(response) {
clearTimeout(timer);
}
}).send();
});