Display on Scroll

PHOTO EMBED

Mon Oct 25 2021 07:26:08 GMT+0000 (UTC)

Saved by @JureVidmar #javascript

  document.addEventListener('scroll',()=>{
        if(window.scrollY > 1400){
            document.querySelector(".sticky-atc-wrapper").style.display = "block";
        } else {
          document.querySelector(".sticky-atc-wrapper").style.display = "none";
        }
    })

//or this code:
document.addEventListener('scroll',()=>{
    function sticky_relocate_2() {
        var window_top = $(window).scrollTop();
        var div_top = $('.comp-col--full').offset().top - 100;
        var div_bottom = $('.comp-row--last').offset().top - 120;

        if (window_top > div_top) {
                $('.comp-row-head--full').addClass('make_it_sticky')
        } 
        //if window top reaches the limit removed class
        if(window_top < div_top){
            $('.comp-row-head--full').removeClass('make_it_sticky');
        }
        if (window_top > div_bottom ) {
            $('.comp-row-head--full').removeClass('make_it_sticky');
        }
    }

    $(window).scroll(sticky_relocate_2);
})
content_copyCOPY

Do stuff when you scroll past certain point