I am using Javascript, jQuery, SVG and SVG.js right now. I would like to turn a circle around its origin while it animates. The animation does the same, so I can use some kind of step function, but I could not find anything. The problem is that with my current solution is janky animation, it has to stop the animation, rotate the circle and start it again. Which in the sequence has too much delay and causes a movement of movement. Here's the installation code:
var draw = SVG('svg'); var innerCircle = draw.group().addClass("atom0g0").move(100,100); innerCircle.circle(100).addClass("atom0p0").center(0, 0).attr({ fill: "white", stroke: "blue", "stroke-dasharray": "10" }); innerCircle.animate(6000).rotate(360, 0, 0).loop();
And the executable code right now that I need to change to something is here:
var elms = $(".atom"+atom.atom_id.toString()+"g0"); for (var j=0; j < elms.length; j++) {
Here's the CodePen I'm working on right now: Current Version or Bugged Version
In short (if you just skipped to the end here) I need to rotate the circle without stopping the animation of the circle completely. I know that play() , pause() does not work, because I cannot call rotate() while the animation is paused.
source share