Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //constructor
- function Animation(){
- this.interval = false;
- this.start = 0;
- this.end = 0;
- this.time = 0;
- this.style = '';
- if(!this.interval) this.interval = setInterval(function(){}, 50);
- };
- Animation.prototype.setProps = function(oProps){
- for(varName in oProps){
- if( oProps.hasOwnProperty("" + varName){
- this["" + varName] = oProps[varName];
- }
- }
- }
- //instantiation
- var a = new Animation();
- a.setProps({
- 'start' : -21,
- 'end' : 0,
- 'time' : 3,
- 'style' : 'top'
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement