PDA

View Full Version : simple increasment question


james.lat
03-17-2010, 07:21 PM
hey everyone i am trying to make a simple increasment for my JS code however i don't know how to do this.
thanks for any help!
-James

function findS()
{
click++;
//How can i use a proper increasment?
if(click==1)
{
code3;
}
if(click==2)
{
code2;
}
if(click==3)
{
set var click to 1, and do the same code in one
}
}

adninjastrator
03-20-2010, 02:33 AM
Well you may need to Google for more info on "incrementing" javascript. It is not "increasment", but rather incrementing the number in one direction or another. You can increment in both the positive and the negative direction.
So while normally you may "increment" in units of 1, you could set that up to "increment" in units of 5 (5, 10, 15 or 5, 0, -5, -10).
I don't know .js so I can't be specific.. but it seems that you are equating clicks with an incrementing value. Two very different values.
Adninjastrator