Team:Grenoble/script

From 2012.igem.org

(Difference between revisions)
Line 56: Line 56:
    c.addEventListener(a,b,d)
    c.addEventListener(a,b,d)
}else{
}else{
-
    c.attachEvent("on"+a,b)}
+
    c.attachEvent("on"+a,b)
 +
        }
     }
     }
Line 71: Line 72:
c.style.MozOpacity=a;
c.style.MozOpacity=a;
c.style.KhtmlOpacity=a
c.style.KhtmlOpacity=a
 +
    }
 +
 +
    function z(c,a,b,d){
 +
    this.elem=c||o.body;
 +
    this.to=a!==undefined?a:1;
 +
    var e=this.elem.style;
 +
    this.from=(b===undefined?(!e.opacity&&e.opacity!==0?(this.to>0?0:1):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;
     }
     }

Revision as of 15:35, 11 July 2012