Template:Team:Sheffield/NavigationBar

From 2014.igem.org

(Difference between revisions)
Line 246: Line 246:
<script>
<script>
$(document).ready(function() { // Document ready
$(document).ready(function() { // Document ready
-
$('a[href^="#"]').on('click',function (event) { // Hyperlink clicked
+
console.log("works");
-
    event.preventDefault(); // Remove current event
+
-
 
+
-
    var target = this.hash,
+
-
    $target = $(target); // Get internal link
+
-
 
+
-
    $('html, body').stop().animate({ // Animate
+
-
        'scrollTop': $target.offset().top
+
-
    }, 500, 'swing', function () {
+
-
        window.location.hash = target;
+
-
    });
+
-
});
+
});
});
</script>
</script>

Revision as of 10:33, 4 October 2014