Hello! Help pzhlst with scrolling implementation: 1. - hide if time has passed 2. - hide if <500px code is left to the bottom of the page:
$('#back-top').on('click', function(e) { e.preventDefault(); $("html, body").animate({scrollTop: 0}, 1000); }); $(window).scroll(function () { if ($(this).scrollTop() > 700) { $('#back-top').fadeIn(); setTimeout(function() { $("#back-top").fadeOut(); }, 2000); } else { $('#back-top').fadeOut(); } }); Now it works when timeout, but periodically starts to blink - it enrages terribly)))