I need to create an infographic that displays several divs containing content including text and 2 variations of the same svg image (one image is green, one is black).
These svg images are small "people", and are expected to display an assortment of both colors (possibly randomly, limited to a number per row so that the order is not the same in each row) in a 10 x 10 grid.
Currently the method is being called on a scroll() event. When called, I'm looping 100 times and individually displaying a single black svg image, adding a number to its tag to indicate where the count is at. While this isn't ideal, it's my approach so far and is working, but slowly.
What I really want to do is display all 100 of these mixed color svg people, at once, when the page loads/document is ready, taking into account adding the "sprinkling" of green people svg's throughout the group. I might be able to use this solution for changing the black svg's CSS to green, but I am definitely stuck on how I'd do this randomly(?) throughout the 100 svg's that display.
One of my thoughts was to possibly call/execute the method that populates/adds 100 black svg's to the div's html, but save it into a single object/array. Once the page is ready, display the entire object/array of 100 svg's at once, then use the above link to change some people green..this is just brainstorming.
The other divs are not as big of an issue, since each displays < 10 people.
Thank you in advance for the help!