Template:Team:Sheffield/NavigationBar
From 2014.igem.org
(Difference between revisions)
Line 28: | Line 28: | ||
$(document).ready(function() { // Document ready | $(document).ready(function() { // Document ready | ||
$( '.inlink' ).on('click', function(event) { | $( '.inlink' ).on('click', function(event) { | ||
- | + | var target = $(this.hash); | |
- | + | target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); | |
- | + | if (target.length) { | |
- | + | $('html,body').animate({ | |
- | + | scrollTop: target.offset().top | |
+ | }, 1000); | ||
+ | return false; | ||
+ | } | ||
}); | }); | ||
}); | }); |
Revision as of 10:58, 4 October 2014