$(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'}); } } });