// jQuery scroll $(function() { $.fn.gotop = function() { $(this).hide().removeAttr("href"); if ($(window).scrollTop() != "0") { $(this).stop().fadeIn(800); } var scrollDiv = $(this); $(window).scroll(function() { if ($(window).scrollTop() == "0") { $(scrollDiv).fadeOut(800) } else { $(scrollDiv).fadeIn(800) } }); $(this).click(function() { $("html, body").animate({ scrollTop: 0 }, "slow") }) } }); $(function() { $("#scrollTop").gotop(); });