If the previous condition is true, we need to collect the SVG icons in an array and then get the class of each one. Each class will behave differently. Go through another loop that gathers the current row element's child elements identified by the tag name I
. And then loop through each of those children's list of classes collected by the classList
method. I will show you how this will look before I tell you what we will do with it. Take a look at the loop in a loop in a loop in this code sample:
function getMovingElements(callback){ for (var i = 0;i<document.getElementsByClassName("row").length; i++) { if((window.pageYOffset + (window.innerHeight)) > document.getElementsByClassName("row")[i].offsetTop && (window.pageYOffset) < (document.getElementsByClassName("row")[i].offsetTop + (window.innerHeight/2*3))) { for (j = 0; j < document.getElementsByClassName("row")[i].getElementsByTagName("i").length...