Template:Team:Sheffield/NavigationBar

From 2014.igem.org

(Difference between revisions)
Line 27: Line 27:
<script>
<script>
$(function() {
$(function() {
-
$('a[href*=#]:not([href=#])').click(function() {
+
$( '.inlink' ).on('click', function(event) {
-
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
+
    event.preventDefault();
-
var target = $(this.hash);
+
    var target = "#" + $(this).data('target');
-
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
+
    $('html, body').animate({
-
if (target.length) {
+
        scrollTop: $(target).offset().top
-
$('html,body').animate({
+
    }, 2000);
-
scrollTop: target.offset().top
+
-
}, 1000);
+
-
return false;
+
-
}
+
-
}
+
-
});
+
});
});
</script>
</script>

Revision as of 10:52, 4 October 2014