When working with Javascript, I have a series of elements with identical divs:
(....loop, where "count" is a unique number for each column)
<other divs>
<div class="pie"></div>
</div>
My goal is to be able to rotate each individual element separately. However, my current approach rotates all the column elements by the same amount:
<% var strng = 'rotate 40deg' %>
<% $("other divs... .pie").css({'-webkit-transform': strng}); %>
To achieve this, I believe I need to modify the structure like so:
<other divs>
<div class"pie">
<div class=count></div>
</div>
And my selector would then look something like this:
<% $("other divs... .pie" + " ." + count).css({'-webkit-transform': strng}); %>
Unfortunately, this method doesn't seem to be effective in practice. Is there a way to use a variable class name for this purpose?
EDIT: The "count" is simply a number. I will try adding a string in front of it to see if that helps - thank you for pointing out that class names cannot start with numbers.
EDIT: I am curious as to why this question seems to be receiving negative feedback. It is a genuine query and I am eager to find a solution. While no answer has worked yet, I have closed the question temporarily. Could it be that the question appears trivial to some users?
EDIT: A JSFiddle has now been included in the post. My first priority is to ensure it functions correctly before delving into the additional adjustments I hope to make.