daily pastebin goal
59%
SHARE
TWEET

Untitled

a guest Jul 16th, 2018 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top