Team:Grenoble/script
From 2012.igem.org
(Difference between revisions)
Line 79: | Line 79: | ||
var e=this.elem.style; | var e=this.elem.style; | ||
this.from=(b===undefined?(parseFloat(e.opacity)):b); | this.from=(b===undefined?(parseFloat(e.opacity)):b); | ||
+ | d=d||{}; | ||
+ | this.duration=d.duration||500; | ||
+ | this.frameRate=d.frameRate||30; | ||
+ | this.onFinish=d.onFinish; | ||
+ | this.totalFrames=Math.ceil(this.duration/1000*this.frameRate); | ||
+ | this.perFrame=(this.to-this.from)/this.totalFrames; | ||
+ | this.frameNb=0;var f=this; | ||
+ | this.next=function(){ | ||
+ | this.prog=setTimeout(function(){f.frame()},1000/this.frameRate)}; | ||
} | } | ||
Revision as of 16:35, 11 July 2012