creativelive / appear

execute callbacks when dom elements appear in and out of view
http://creativelive.github.io/appear/
MIT License
177 stars 43 forks source link

Disappear is never called #14

Closed rsoesemann closed 6 years ago

rsoesemann commented 6 years ago

I don't get why this configuration of appear.js doesn't fire the disappear event. I only see appear to be called.

window.appear({
            init: function init() {
                console.log("init");
            },
            elements: function elements() {
                let rowGroups = document.getElementsByClassName("row-group");
                console.log("Tracking #: " + rowGroups.length);
                return rowGroups;
            },
            appear: function appear(group) {
                cmp.getEvent("loadRowGroup")
                    .setParams({ data: group.id })
                    .fire();
            },
            disappear: function disappear(group) {
                cmp.getEvent("unloadRowGroup")
                    .setParams({ data: group.id })
                    .fire();
            },
            bounds: 200,
            reappear: true
        });

Does it have to do with how my DOM looks like? When I don't scroll it just show a single . Appear() is called once. But when I just scroll a few pixels for ALL the other elements appear() is called. Without them being visible.