Difference between revisions of "Team:TUDelft/Header"

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) {
 
+
                        // Add hash (#) to URL when done scrolling (default click behavior)
 +
                        window.location.hash = hash;
 
                 // 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 752: Line 753:
 
                     $('html, body').animate({
 
                     $('html, body').animate({
 
                         scrollTop: $(hash).offset() .top -100
 
                         scrollTop: $(hash).offset() .top -100
                     }, 800, function(){
+
                     }, 800
 
+
                        // Add hash (#) to URL when done scrolling (default click behavior)
+
                        window.location.hash = hash;
+
                    });
+
 
                 } // End if
 
                 } // End if
 
             });
 
             });

Revision as of 23:42, 18 October 2019