'use strict'; $jq(document).ready(function ($) { // Bind to scroll. $(window).scroll(function () { //Display or hide scroll to top button. if ($(this).scrollTop() > 100) { $('#scroll-top-link').fadeIn(); } else { $('#scroll-top-link').fadeOut(); } }); // Function for scrolling to top. $('#scroll-top-link').click(function () { $("html, body").animate({ scrollTop: 0 }, 600); return false; }); });