jQuery - scroll event with multiple conditions

0 votes
304 views
added Dec 18, 2020 in jQuery by lcjr First Warrant Officer (11,830 points)
$(window).scroll(function() { 
    if (window.scrollY > 1) {
        HideAppBanner(); 
        adParallax.css({'top': '140px'});
    } else {
        ShowAppBanner();
        if ($(window).width() > 425) {
            adParallax.css({'top': '162px'});
        }
        else {
            adParallax.css({'top': '150px'});
        }
    }     
});

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...