Librairie effets javascript

Disponible uniquement sur Etudier
  • Pages : 2 (469 mots )
  • Téléchargement(s) : 0
  • Publié le : 21 avril 2010
Lire le document complet
Aperçu du document
(function( window ) {
var Animate = function(Obj, Property, Duration, Begin, End, CallBack, Type, Speed){
// Property
this.domId = Obj;
this.cssProperty = Property;
this.animationTime= Duration;
this.beginning = parseFloat(Begin);
this.end = parseFloat(End);
this.callBack = CallBack || null;
this.type = Type || 'regular';
this.speed = Speed || 25;
this.mode ='break';
var _this = this;
this.current = 0;
this.intervalId = null;
this.stepValue = 0;
this.isIe = this.getIeVersion();

// Method
this.timerDelegate = function(){_this.animate();
};
this.callBackDelegate = function(){
_this.runCallBack();
};
this.play = this.Play;
this.pause = this.Pause;
this.reverse = this.Reverse;
}Animate.prototype = {
debugMode: true,
log: function(e){
try {
if (this.debugMode)console.info('Debug >> ' + e);
}
catch (e) {
};
},
Play: function(){
if(this.mode!= 'play' && this.mode != 'reverse'){
document.getElementById(this.domId).style[this.cssProperty] = this.beginning + 'px';
this.length =(this.animationTime / this.speed ) - this.current;
this.increment = ((this.end - this.beginning) / (this.animationTime / this.speed));
this.current = 0;this.mode = 'play';
this.stepValue = this.beginning;
this.intervalId = setInterval(this.timerDelegate, this.speed);
}},
Reverse: function(){
if(this.mode != 'play' && this.mode != 'reverse'){
var backup = this.end;
this.end =...
tracking img