Prinzhorn / skrollr

Stand-alone parallax scrolling library for mobile (Android + iOS) and desktop. No jQuery. Just plain JavaScript (and some love).
http://prinzhorn.github.io/skrollr/
MIT License
18.53k stars 3.51k forks source link

Disable reversing on specific elements #862

Open JacobDB opened 6 years ago

JacobDB commented 6 years ago

I've got a page which utilizes skrollr for fading in some elements and for making some background images "parallax." Once the elements are faded in, they need to remain faded in (i.e. not be reversible), while keeping the parallax image effect on other elements. Is this possible with skrollr?

I've tried using the following, but it disables all effects after they complete:

skrollr.init({
    beforerender: (data) => {
        return data.curTop > data.lastTop;
    }
});

I've tried console.log(data) to see if there's anything in there that could be useful, but I don't see anything that would allow me to disable skrollr on some elements but not others.