0
Can some one tell me how to make the second div slower than the first?
12 Antworten
+ 6
Maintain two sperate variables for each animation.
https://code.sololearn.com/WwXokwQgx8AI/?ref=app
+ 4
🔫 Rick Grimes too many flaws 😬🔫
I thought that the variable 'pos' is the rate of change and not the change itself 😆
+ 4
Dani Mecoss why all?
I didn't help you
Instead, I got confused 😌😆😂
+ 4
Dani Mecoss 😆😆🙂
You're welcome then 😅
+ 3
https://code.sololearn.com/WylRmxi4JfWc/?ref=app
It looks the same speed even when you change the time interval because the 'pos' variable increases at the same rate as the more speedier one.
+ 3
Just put a smaller value in line 26
Like: pos+=0.5
+ 3
🔫 Rick Grimes Ohh 🤔
I didn't know he used a single variable for 2 different animations 😳
+ 3
🔫 Rick Grimes what about changing the time interval 🙌
In line just put a value > 10
+ 2
Namit, try it as well.
If you run the second animation after 500ms and first is running at 10ms then value of pos will still be changing because of animation1.
+ 1
Namit Jain try it.
He uses one variable for both animation, so value will be same no matter how less you add.
+ 1
thx all
+ 1
namit cuz u take the time at least to confuse me