Difference between revisions of "Team:TUDelft/Header"

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

Revision as of 23:44, 18 October 2019