(function($){ $(document).ready(function() { var scrolldownToView = $('.scrolldown-to-view'); $(window).scroll(function() { if (window.scrollY > 1) { scrolldownToView.fadeOut(400); } else { scrolldownToView.fadeIn(400); } }); }); })(jQuery);