1$(document).ready(function(){ 2 // Add smooth scrolling to all links 3 $("a").on('click', function(event) { 4 5 // Make sure this.hash has a value before overriding default behavior 6 if (this.hash !== "") { 7 // Prevent default anchor click behavior 8 event.preventDefault(); 9 10 // Store hash 11 var hash = this.hash; 12 13 // Using jQuery's animate() method to add smooth page scroll 14 // The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area 15 $('html, body').animate({ 16 scrollTop: $(hash).offset().top 17 }, 800, function(){ 18 19 // Add hash (#) to URL when done scrolling (default click behavior) 20 window.location.hash = hash; 21 }); 22 } // End if 23 }); 24}); 25 26 27 28// When the user scrolls down 20px from the top of the document, show the button 29window.onscroll = function() {scrollFunction()}; 30 31function scrollFunction() { 32 if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) { 33 document.getElementById("topbtn").style.display = "block"; 34 } else { 35 document.getElementById("topbtn").style.display = "none"; 36 } 37} 38 39// When the user clicks on the button, scroll to the top of the document 40function topFunction() { 41 42 $("html, body").animate({ scrollTop: 0 }, 600); 43 return false; 44 //document.body.scrollTop = 0; // For Chrome, Safari and Opera 45 // document.documentElement.scrollTop = 0; // For IE and Firefox 46}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.