Line 739: | Line 739: | ||
// Add smooth scrolling to all links | // Add smooth scrolling to all links | ||
$(".jump").on('click', function(event) { | $(".jump").on('click', function(event) { | ||
− | + | ||
− | + | ||
// Make sure this.hash has a value before overriding default behavior | // Make sure this.hash has a value before overriding default behavior | ||
if (this.hash !== "") { | if (this.hash !== "") { | ||
Line 748: | Line 747: | ||
// Store hash | // Store hash | ||
var hash = this.hash; | var hash = this.hash; | ||
− | + | // Add hash (#) to URL when done scrolling (default click behavior) | |
+ | window.location.hash = hash; | ||
// Using jQuery's animate() method to add smooth page scroll | // Using jQuery's animate() method to add smooth page scroll | ||
// The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area | // The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area |
Revision as of 07:44, 19 October 2019