I've been working on a code snippet that positions div elements around a circle:
angle = 0; mangle = 0;
for(i = 1; i<= count; i++)
{
$("#p" +i).css("transform", "rotate(" + angle + "deg) translate(250px) rotate("+mangle+"deg)");
angle = 360 / count;
mangle = (-1) * angle;
}
However, I'm facing an issue where the second rotation replaces the first one in the end! For instance, I expect it to be:
rotate(30deg) translate(250px) rotate(-30deg)
But it actually turns out as:
rotate(-30deg) translate(250px)
I even gave a shot, but it didn't fix the problem. Can anyone help me identify what's causing this?