Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
IO 0.59 KB | None | 0 0
  1. //constructor
  2. function Animation(){
  3.     this.interval = false;
  4.     this.start = 0;
  5.     this.end = 0;
  6.     this.time = 0;
  7.     this.style = '';
  8.  
  9.        if(!this.interval) this.interval = setInterval(function(){}, 50);
  10.   };
  11.  
  12.   Animation.prototype.setProps = function(oProps){
  13.       for(varName in oProps){
  14.         if( oProps.hasOwnProperty("" + varName){
  15.       this["" + varName] = oProps[varName];
  16.     }
  17.       }
  18.   }
  19.  
  20.  
  21. //instantiation
  22.       var a = new Animation();
  23.       a.setProps({
  24.         'start' : -21,
  25.         'end'   : 0,
  26.         'time'  : 3,
  27.         'style' : 'top'
  28.       });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement