- This topic is empty.
April 6, 2014 at 3:32 pm #167755
here is the fiddle on what i am trying to do. i want to make one ball on the circle that is constant in position i.e., not spinning. the main aim is to escape constant ball(by assigning a button to jump) from the main ball. if the main ball which is rotating from my fiddle touches any of the constant ball then it should end. one point for each ball escape. i cant position a constant ball on the circle. here is an example of what i like 2 do.here is an example of what i like 2 do. http://www.lessmilk.com/9/April 7, 2014 at 2:10 am #167778Paulie_DMember
You’re animating the wrong object.
You don’t want the circle to rotate, you want the ball to rotate.
Idea borrowed from Lea Verou : http://lea.verou.me/2012/02/moving-an-element-along-a-circle/
Exact positioning of the ‘static’ ball is a little more finicky.April 7, 2014 at 8:38 am #167785April 7, 2014 at 8:48 am #167786Paulie_DMember
My point was that you should be using the
translatenumbers to affect the actual position of each ball…not the margin.
The initial margins just center the ball, the translate options can move it around the ball…and the final positioning was done by adjusting the margin.
A far amount of math (or JS) is going to be required depending on where you want the balls to be…April 7, 2014 at 9:48 am #167790
thanq paul for quick reply. i followed ur way to change the
translatenumbers and its fine. the only problem is its not executing on jsfiddle. so how can i assign a button to move colored balls back and forth to avoid collision from blue ball.April 7, 2014 at 10:41 am #167791
code working fine in fiddle as well. just use
-webkit-transformto make it workApril 7, 2014 at 11:35 am #167795
so how can i assign a button to move colored balls back and forth to avoid collision from blue ball.
- The forum ‘CSS’ is closed to new topics and replies.