I am trying to come up with a simple tweening prototype. I have two
issues. The first is, why can't i have a div, with
onclick="this.tweento();" - why does that produce an error
"this.tweento(); is not a function". Second, how can I make the
function below, actually work ...
regards,
-eddie
/* Begin code */
// t = current time
// b = start value
// c = change in value
// d = duration
// Robert Penners Easing functions
easeInQuad = function(t,b,c,d) {
t/=d;
return c*t*t+b;
}
HTMLobj.prototype.tweenTo = function(method, start, end, time) {
if(!this._tweenRunning) {
this._tweenTime=0;
var s='['+start.toString()+']';
var e='['+end.toString()+']';
this._timer=setInterval(this._obj+'.tweenTo('+meth od+','+s+','+e+','+time+')',33);
this._tweenRunning=true;
}
if(++this._tweenTime>time){
this.cancelTween();
}else{var w=method(this._tweenTime,start[0],end[0]-start[0],time);
var h=method(this._tweenTime,start[1],end[1]-start[1],time);
this.sizeTo(w,h);
}
}