473,387 Members | 1,510 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Tweening with robert penners quadratic equations

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);
}
}

Nov 12 '06 #1
1 1317
VK
eddie wrote:
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".
see
<http://groups.google.com/group/comp.lang.javascript/msg/2a533313710fdb1b>

Nov 12 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: smjmitchell | last post by:
Hi All, I need to display some equations on a form in VB (I will print the result in a text box beside the equation). The equations will in some cases be quite complicated and include...
6
by: fb | last post by:
Hello everyone. I'm having a touch of trouble solving a problem using the quadratic formula. I get a domain error...Somewhere in the sqrt function I think. Could you guys give me a hint on...
8
by: vj | last post by:
Hi all, I want to solve the two equations u*tan(u)=w and u^2 + w^2=V^2, where V is a known constant, and u and w are the two unknowns to be determined. Please can someone suggest me how to...
3
by: amitsoni.1984 | last post by:
Hi, I need to do a quadratic optimization problem in python where the constraints are quadratic and objective function is linear. What are the possible choices to do this. Thanks Amit
6
by: Trev17 | last post by:
Hello, I am new to C++ and i have tried for several hours to make a program my teacher has given me as a lab. Here is the Lab question: the roots of the quadratic equation ax^2 + bx + c = 0, a...
2
by: DaRok28 | last post by:
// Program Description: // This program solves quadratic equations to find their roots. This // program takes values of a, b, and c as input and outputs the root(s). // The user can repeat the...
3
by: sjabang1 | last post by:
Hay guys i want to programme a quadratic of this nature ax2+bx+c=o
1
by: bbench123 | last post by:
Make a program that will ask for values of a quadratic equation (ax2+bx+c). the program must determine the roots of the equation using the quadratic equation determinants to distinguish if the roots...
4
by: sdufoo | last post by:
Hallo guys, I have to solve a system of Differential equations: http://picasaweb.google.de/sdufoo/EcuacionesDiferenciales02/photo#5228386949051570594 these are the equations of an induction...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.