Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
IO 0.63 KB | None | 0 0
  1.   function animation(){
  2.     this.interval = false,
  3.     propSet = false,
  4.     start = 0,
  5.     end = 0,
  6.     time = 0,
  7.     style = '';
  8.  
  9.     this.setProps = function(oProps){
  10.       for(varName in oProps){
  11.         this[varName] = oProps[varName];
  12.       }
  13.  
  14.       propSet = true;
  15.     }
  16.  
  17.     this.readProp = function(prop){
  18.       return this[prop];
  19.     }
  20.  
  21.     if(!this.interval) this.interval = setInterval(function(){}, 50);
  22.   };
  23.  
  24.  
  25.       var a = new animation();
  26.       a.setProps({
  27.         'start' : -21,
  28.         'end'   : 0,
  29.         'time'  : 3,
  30.         'style' : 'top'
  31.       });
  32.       console.log(a.readProp('propSet'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement