Guest User

Untitled

a guest
Jul 16th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. window.addEvent('domready', function() {
  2.  
  3. var myTween = new Fx.Tween('diBG',{duration:1000});
  4.  
  5. //We can use one Request object many times.
  6. var req = new Request.HTML({url:'efficiencysb.php',
  7.  
  8.  
  9.  
  10. onSuccess: function(html) {
  11. myTween.start('opacity','0').chain(
  12. function(){
  13. $('diBG').set('text','');
  14. $('diBG').adopt(html);
  15. $('time').set('text','Last updated on');
  16. myTween.start('opacity','1');
  17. }
  18. );
  19.  
  20. },
  21. //Our request will most likely succeed, but just in case, we'll add an
  22. //onFailure method which will let the user know what happened.
  23. onFailure: function() {
  24. $('result').set('text', 'The request failed.');
  25. }
  26. });
  27.  
  28. $('makeRequest').addEvent('click', function() {
  29. req.send();
  30. });
  31.  
  32. });
Add Comment
Please, Sign In to add comment