Skip to content

Commit

Permalink
Added scroll to internal links.
Browse files Browse the repository at this point in the history
  • Loading branch information
davorg committed Jan 26, 2015
1 parent 53ce7e8 commit 85a7208
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion js/main.js
Expand Up @@ -9,4 +9,19 @@ function setCounter () {
$('#counter').html( daysToGo() + " Days to go" );
}

$( document ).ready( setCounter );
$( document ).ready(function() {
setCounter;

$('a[href^="#"]').on('click',function (e) {
e.preventDefault();

var target = this.hash;
var $target = $(target);

$('html, body').stop().animate({
'scrollTop': $target.offset().top
}, 900, 'swing', function () {
window.location.hash = target;
});
});
} );

0 comments on commit 85a7208

Please sign in to comment.