Hi,
I am currently learning JS and are doing simple “experiments” as a way of learning.
In this one I am creating a number of elements and then creating a number of elements inside these. Atm it’s a total of 400 elements (20x20) (stripes and crosses).
If I wanted to not have a set number of elements like now, and instead take the number as a parameter, how would I go on to:
-
make the width of the first bunch of elements equal adding up to 100% width of the parent? Would i take the width of the parent and then divide it by the number(parameter) given and then apply this as the value?
-
How to equally distribute the dots with position absolute along the width of the parent stripe with the “left” css attribute?
All in all, how would you replicate something like this http://codepen.io/ReGGae/pen/NxPboz?editors=001 in a more dynamic way?