I want to create an effect, where when a user scrolls to a certain Div, elements within it appear in order, starting from the left-most element to the right-most. I’ve been successful with just making multiple elements appear if a user scrolls vertically to a certain div, now I am trying achieve showing elements within a div show in a certain order.
Here is what I have tried so far. Before I get to the Jquery aspect, I gave each of the elements/their classes CSS displays of “none” and just use the .show() function in Jquery. These are all just placeholder names used in this example expect for gmp-map, or a Google Map.
`window.addEventListener("scroll", function() {
if (this.window.scrollY >= 116) {
const div = $(".div");
const divImg = $(".div>.col>img");
const map = $("gmp-map");
function showDiv1Elements() {
divImg.show();
}
function showDiv2Elements() {
map.show();
}
div.on(scrollY, showDiv1Elements);
div.on(scrollY, showDiv2Elements);
}
});`